Repository navigation
Hide project actions the user's role can't perform - #49
Merged
Merged
Conversation
The project options sheet (Home card and folder top bar) now follows the project role, as file menus do since #42: rename, restricted, archive and delete only for full_access and account owners/admins; share links and 'Send project link' for editor and up; recently deleted for edit_only and up. Members, Collections and notifications stay for every role. The role is read when the sheet opens and cached per session; an unknown role still shows everything. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keep the stateless ProjectMenuContent and take the project's cover from Project.imageRef (#48). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 of 3 tasks
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.
What changes
Before: the project "⋯" sheet (project card on Home) and the "⋯" in a project's top bar offered Rename, Restricted, Archive, Delete, Share links, Recently deleted and "Send project link" to every member. A
viewercould tap them, and Frame.io then refused.After: both menus follow the user's role on the project, as file menus already do (#42). A viewer or commenter sees notifications, Members and Collections. Rows the role allows appear once the role is known.
How
FileAccessgets a project-levelprojectSettingsflag.editoris no longerFull: it keeps every file action but not project settings.projectActionsFor(access)inProjectSheets.ktturns the access into the sheet's rows.ProjectMenuSheetnow wraps a statelessProjectMenuContent, so the screenshot test can render it.FrameioRepository.fileAccess, which is cached per session.cachedFileAccessgives the sheet's first frame the cached value, so a second open doesn't jump. While the role is still loading, the sheet shows only the read-only rows. An unknown role, or a lookup that fails, still shows everything: the server has the last word.FolderScreen, the top-barProjectActions.sharesandProjectActions.trashare null when the role can't use them.Mapping, from Frame.io's Managing user permissions guide (project roles:
full_access= "upload, manage, share, comment, view, download, manage settings, and invite users";editor= everything except settings and invites;edit_only= "cannot share or download";commenter= view and comment;viewer= view only). Restricted projects also follow the help center footnote "Edit & Share and Edit cannot make restricted projects".edit_onlyand up ("manage" files, which covers delete and restore)editorand up ("share")full_access, account owner/admin,workspace_admin("manage settings")Not in this PR: the Members screen itself still shows its invite and role controls to everyone.
Checks
:app:testDebugUnitTest --tests FileAccessTestand:app:lintDebugpass on the workstation (lint at 0). The newproject_menu_viewerbaseline was recorded from CI (Linux).project_menu_viewer)viewermember on a shared project): not done yet, nothing is installed on the phone without the maintainer's OK🤖 Generated with Claude Code