Skip to content

PM-6515 Make the Assets Library read-only for non-member Talent Managers -> dev - #2432

Merged
jmgasper merged 1 commit into
devfrom
PM-6515-1
Oct 5, 2026
Merged

jmgasper merged 1 commit into
devfrom
PM-6515-1

Conversation

@jmgasper

@jmgasper jmgasper commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

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.

  • New checkCanAddProjectAssets(userRoles, userId, project) in permissions.utils.ts: returns true for Administrators and project members.
  • ProjectAssetsPage hides 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.
  • The Work README's project workspace access section documents the read-only behaviour.

Project members keep their current behaviour.

Validation

  • yarn lint: passed
  • NODE_OPTIONS=--max-old-space-size=8192 yarn run build: passed
  • Work specs for assets, users, lib/utils and ProjectRouteAccessGuard: 18 suites, 179 tests passed.
  • New tests:
    • checkCanAddProjectAssets unit cases (admin, members, non-member Talent Managers, missing project).
    • ProjectAssetsPage shows the add actions when allowed, and shows a read-only library with attachments still listed for non-member Talent Manager / Topcoder Talent Manager.
    • The read-only page tests fail against the current dev page.

Manual QA (after projects-api-v6#50 is deployed)

  1. Sign in as a Talent Manager who is not a member of a non-internal project (e.g. /projects/100591).
  2. Users: members and pending invites are listed, with no Add User / Invite User buttons.
  3. Assets Library: files and links are listed, with no Add New File / Add New Link button.
  4. As a project member or admin, the Assets Library add buttons still appear and work.

🤖 Generated with Claude Code

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>
@jmgasper
jmgasper requested a review from kkartunov as a code owner October 5, 2026 00:05
@jmgasper
jmgasper merged commit 1303657 into dev Oct 5, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant