File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -191,6 +191,7 @@ export const PERMISSION = { // eslint-disable-line import/prefer-default-export
191
191
topcoderRoles : [
192
192
...TOPCODER_ROLES_ADMINS ,
193
193
USER_ROLE . MANAGER ,
194
+ USER_ROLE . PROJECT_MANAGER ,
194
195
] ,
195
196
projectRoles : ALL ,
196
197
scopes : SCOPES_PROJECTS_READ ,
@@ -205,6 +206,7 @@ export const PERMISSION = { // eslint-disable-line import/prefer-default-export
205
206
topcoderRoles : [
206
207
...TOPCODER_ROLES_ADMINS ,
207
208
USER_ROLE . MANAGER ,
209
+ USER_ROLE . PROJECT_MANAGER ,
208
210
] ,
209
211
scopes : SCOPES_PROJECTS_READ ,
210
212
} ,
Original file line number Diff line number Diff line change @@ -661,6 +661,7 @@ module.exports = [
661
661
( sort && _ . indexOf ( sortableProps , sort ) < 0 ) ) {
662
662
return util . handleError ( 'Invalid filters or sort' , null , req , next ) ;
663
663
}
664
+
664
665
// check if user only wants to retrieve projects where he/she is a member
665
666
const memberOnly = _ . get ( filters , 'memberOnly' , false ) ;
666
667
filters = _ . omit ( filters , 'memberOnly' ) ;
@@ -674,7 +675,7 @@ module.exports = [
674
675
} ;
675
676
req . log . info ( criteria ) ;
676
677
// TODO refactor (DRY) code below so we don't repeat the same logic for admins and non-admin users
677
- if ( ! memberOnly && util . hasPermission ( PERMISSION . READ_PROJECT_ANY , req . authUser ) ) {
678
+ if ( memberOnly !== 'true' && util . hasPermission ( PERMISSION . READ_PROJECT_ANY , req . authUser ) ) {
678
679
// admins & topcoder managers can see all projects
679
680
return retrieveProjects ( req , criteria , sort , req . query . fields )
680
681
. then ( ( result ) => {
You can’t perform that action at this time.
0 commit comments