Skip to content

Hide project actions the user's role can't perform - #49

Merged
TeoVader merged 3 commits into
mainfrom
fix/project-menu-role
Nov 11, 2026
Merged

TeoVader merged 3 commits into
mainfrom
fix/project-menu-role

Conversation

@TeoVader

Copy link
Copy Markdown
Owner

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 viewer could 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

  • FileAccess gets a project-level projectSettings flag. editor is no longer Full: it keeps every file action but not project settings.
  • projectActionsFor(access) in ProjectSheets.kt turns the access into the sheet's rows. ProjectMenuSheet now wraps a stateless ProjectMenuContent, so the screenshot test can render it.
  • The role is read only when the sheet opens, never per card, through FrameioRepository.fileAccess, which is cached per session. cachedFileAccess gives 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.
  • In FolderScreen, the top-bar ProjectActions.shares and ProjectActions.trash are 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".

Row Shown for
Notifications everyone (a local setting)
Members (list) everyone (read-only list; the guide doesn't restrict viewing it)
Collections everyone (viewing; the guide is silent, so the server decides)
Recently deleted edit_only and up ("manage" files, which covers delete and restore)
Share links, Send project link editor and up ("share")
Rename, Restricted, Archive/Restore, Delete full_access, account owner/admin, workspace_admin ("manage settings")
any row, unknown role shown

Not in this PR: the Members screen itself still shows its invite and role controls to everyone.

Checks

  • :app:testDebugUnitTest --tests FileAccessTest and :app:lintDebug pass on the workstation (lint at 0). The new project_menu_viewer baseline was recorded from CI (Linux).
  • New or changed UI has a Roborazzi screenshot (project_menu_viewer)
  • Tried on a phone (with a viewer member on a shared project): not done yet, nothing is installed on the phone without the maintainer's OK

🤖 Generated with Claude Code

TeoVader and others added 3 commits November 11, 2026 21:33
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>
@TeoVader
TeoVader merged commit 861f808 into main Nov 11, 2026
2 checks passed
@TeoVader
TeoVader deleted the fix/project-menu-role branch November 11, 2026 22:16
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