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
191191 topcoderRoles : [
192192 ...TOPCODER_ROLES_ADMINS ,
193193 USER_ROLE . MANAGER ,
194+ USER_ROLE . PROJECT_MANAGER ,
194195 ] ,
195196 projectRoles : ALL ,
196197 scopes : SCOPES_PROJECTS_READ ,
@@ -205,6 +206,7 @@ export const PERMISSION = { // eslint-disable-line import/prefer-default-export
205206 topcoderRoles : [
206207 ...TOPCODER_ROLES_ADMINS ,
207208 USER_ROLE . MANAGER ,
209+ USER_ROLE . PROJECT_MANAGER ,
208210 ] ,
209211 scopes : SCOPES_PROJECTS_READ ,
210212 } ,
Original file line number Diff line number Diff line change @@ -661,6 +661,7 @@ module.exports = [
661661 ( sort && _ . indexOf ( sortableProps , sort ) < 0 ) ) {
662662 return util . handleError ( 'Invalid filters or sort' , null , req , next ) ;
663663 }
664+
664665 // check if user only wants to retrieve projects where he/she is a member
665666 const memberOnly = _ . get ( filters , 'memberOnly' , false ) ;
666667 filters = _ . omit ( filters , 'memberOnly' ) ;
@@ -674,7 +675,7 @@ module.exports = [
674675 } ;
675676 req . log . info ( criteria ) ;
676677 // 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 ) ) {
678679 // admins & topcoder managers can see all projects
679680 return retrieveProjects ( req , criteria , sort , req . query . fields )
680681 . then ( ( result ) => {
You can’t perform that action at this time.
0 commit comments