Repository navigation
Conversation
Talent Managers can now open non-internal projects without membership, and projects-api-v6 PR #50 lets them read the project's attachments. The Assets Library still showed "Add New File" / "Add New Link" to them, but the API rejects their attachment creates, so a file picked through Filestack would upload and then fail to save. Add checkCanAddProjectAssets (admins and project members) and hide the add actions for other viewers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related JIRA Ticket
PM-6515
What's in this PR?
QA follow-up (comment): non-member Talent Managers could open non-internal projects after #2428, but the Users tab showed no members and Assets Library showed "Insufficient permissions".
Root cause is in the API. The projects API didn't grant Talent Managers the member, invite and attachment read permissions. That's fixed in projects-api-v6#50, which must be deployed for those two tabs to load. The Users tab needs no UI change: its Add/Invite actions are already gated by
checkCanManageProject.This PR fixes the follow-on UI gap. Once attachments load, the Assets Library still showed Add New File / Add New Link to every viewer. The API rejects attachment creates from non-members, so a Talent Manager could pick and upload a file through Filestack and then hit a 403 when it saved.
checkCanAddProjectAssets(userRoles, userId, project)inpermissions.utils.ts: returnstruefor Administrators and project members.ProjectAssetsPagehides the add button for everyone else, so non-member Talent Managers get a read-only library. Per-attachment edit/delete was already limited to admins and the attachment's creator.Project members keep their current behaviour.
Validation
yarn lint: passedNODE_OPTIONS=--max-old-space-size=8192 yarn run build: passedlib/utilsandProjectRouteAccessGuard: 18 suites, 179 tests passed.checkCanAddProjectAssetsunit cases (admin, members, non-member Talent Managers, missing project).ProjectAssetsPageshows the add actions when allowed, and shows a read-only library with attachments still listed for non-memberTalent Manager/Topcoder Talent Manager.devpage.Manual QA (after projects-api-v6#50 is deployed)
/projects/100591).🤖 Generated with Claude Code