File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 3131 "md5" : " ^2.1.0" ,
3232 "ms-amqp-conf" : " ^0.2.0" ,
3333 "ms-amqp-transport" : " ^1.3.0" ,
34- "ms-files-gce" : " ^0.6.1 " ,
34+ "ms-files-gce" : " ^0.6.3 " ,
3535 "ms-validation" : " ^1.0.1" ,
3636 "mservice" : " ^1.6.0" ,
3737 "redis-filtered-sort" : " ^1.1.1"
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ const Promise = require('bluebird');
22const fetchData = require ( '../utils/fetchData.js' ) ;
33
44const { NotImplementedError, HttpStatusError } = require ( 'common-errors' ) ;
5- const { FILES_DATA , FILES_OWNER_FIELD , FILES_PUBLIC_FIELD } = require ( '../constant.js' ) ;
5+ const { FILES_DATA , FILES_OWNER_FIELD } = require ( '../constant.js' ) ;
66
77/**
88 * File information
@@ -32,8 +32,9 @@ module.exports = function getFileInfo(opts) {
3232 // ref file
3333 const info = data . file ;
3434
35- // check access permissions
36- if ( info [ FILES_OWNER_FIELD ] !== data . username && ! info [ FILES_PUBLIC_FIELD ] ) {
35+ // check that owner is a match
36+ // even in-case with public we want the user to specify username
37+ if ( info [ FILES_OWNER_FIELD ] !== data . username ) {
3738 throw new HttpStatusError ( 404 , 'file not found' ) ;
3839 }
3940
You can’t perform that action at this time.
0 commit comments