-
Notifications
You must be signed in to change notification settings - Fork 56
fix(PM-1067): allow project managers to view applications of opportunity not b… #807
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…elonging to their projects
…elonging to their projects
…elonging to their projects
@@ -21,23 +21,17 @@ module.exports = freq => new Promise((resolve, reject) => { | |||
const req = freq; | |||
req.context = req.context || {}; | |||
req.context.currentOpportunity = opportunity; | |||
const projectId = opportunity.projectId; | |||
const isProjectManager = util.hasProjectManagerRole(req); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable projectId
is declared but not used in the updated code. Consider removing it to clean up the code.
}).then((copilotApplication) => { | ||
// check if auth user has access to this project | ||
const hasAccess = util.hasAdminRole(req) || isProjectManager || !!copilotApplication; | ||
return Promise.resolve(hasAccess); | ||
}) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hasAccess
logic has changed. Ensure that the removal of isPartOfProject
does not affect the intended access control logic. Verify that project managers should have access regardless of project membership.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
What's in this PR?
Ticket link - https://topcoder.atlassian.net/browse/PM-1067