Skip to content

[codex] Fix workspace delete permission rendering#660

Merged
yaojin3616 merged 1 commit into
mainfrom
codex/fix-workspace-delete-permissions-656
Jun 10, 2026
Merged

[codex] Fix workspace delete permission rendering#660
yaojin3616 merged 1 commit into
mainfrom
codex/fix-workspace-delete-permissions-656

Conversation

@sara2398

@sara2398 sara2398 commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Pass workspace manage permission into the live Workspace side panel.
  • Hide workspace mutation actions for users without manage access.
  • Keep enterprise_info permission handling separate via canManageEnterpriseInfo.

Fix

Fixes #656.

Root Cause

The main Workspace tab already gated delete actions with canManage, but the live Workspace side panel did not receive the same workspace manage permission. As a result, non-admin/non-manage users could still see delete controls in that panel even though backend deletion was blocked.

Validation

  • Ran git diff --check.
  • Frontend build was not run because node/npm/pnpm/yarn are unavailable in this shell environment.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f8592951d4

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +442 to +444
const canModifyPath = (path?: string | null) => (
isEnterprisePath(path) ? canManageEnterpriseInfo : canManageWorkspace
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve workspace edits for use-level users

For agents where the current user has access_level: "use", this makes canModifyPath('workspace/...') false, which also suppresses the side-panel edit button via canEdit and blocks create/upload actions. The rest of the workspace UI still enables upload, newFile, newFolder, and edit for these users while gating only delete on canManage (AgentDetailPage.tsx:5792), and the write endpoint only requires check_agent_access (backend/app/api/files.py:604), so this commit removes an allowed workflow from the live side panel rather than just hiding unauthorized deletes.

Useful? React with 👍 / 👎.

@yaojin3616 yaojin3616 merged commit aa83f60 into main Jun 10, 2026
1 check failed
@yaojin3616 yaojin3616 deleted the codex/fix-workspace-delete-permissions-656 branch June 10, 2026 07:07
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.

[UX Improvement] Hide delete button for non-admin users instead of showing disabled state

2 participants