Skip to content

feat(project): hide project sharing actions from non-admins#597

Merged
dembrane-sam-bot merged 1 commit into
mainfrom
sam/project-sharing-member-permissions
May 27, 2026
Merged

feat(project): hide project sharing actions from non-admins#597
dembrane-sam-bot merged 1 commit into
mainfrom
sam/project-sharing-member-permissions

Conversation

@dembrane-sam-bot
Copy link
Copy Markdown
Contributor

@dembrane-sam-bot dembrane-sam-bot commented May 27, 2026

What this changes

  • workspace members (non-admins) will no longer see "Manage" and "Make private" buttons in ProjectSharingStrip — ProjectSharingStrip.tsx
  • workspace members (non-admins) will no longer see the InviteMemberCard ("Share with someone" or "Make private to invite specific members") in ProjectUsageAndSharing — ProjectUsageAndSharing.tsx
  • completely removed the redundant "Make private to invite specific members" card/button in the members list when a project is workspace-visible (isWorkspaceVisible) — ProjectUsageAndSharing.tsx

Confidence

Confidence: high. Spacing, imports, and component structure were carefully edited using tab-indentation matching the existing files. The user-visible change directly aligns with workspace roles (restricting to isAdminRole), which only owners and admins possess. No changes were made to backend APIs.

Summary by CodeRabbit

  • Bug Fixes
    • Restricted project visibility management controls ("Manage" and "Make private") to workspace administrators only
    • Restricted member invitation functionality to workspace administrators for projects not shared with the entire workspace
    • Improved access control to ensure only authorized users can modify sharing settings and invite team members

Review Change Stack

@github-actions
Copy link
Copy Markdown

Hi @dembrane-sam-bot!

Thank you for contributing to Dembrane ECHO! Before we consider your Pull Request, we ask that you sign our Contributor License Agreement (CLA). This is only required for your first Pull Request.

Please review the CLA, and sign it by adding your GitHub username to the contributors.yml file. Thanks!

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 27, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 32ff20fb-f740-45b2-8fc0-13a8a0cffaff

📥 Commits

Reviewing files that changed from the base of the PR and between 2bdd1e6 and ccc8a92.

📒 Files selected for processing (2)
  • echo/frontend/src/components/project/ProjectSharingStrip.tsx
  • echo/frontend/src/components/project/ProjectUsageAndSharing.tsx

Walkthrough

Restricts project sharing and member invitation UI to workspace admins. ProjectSharingStrip conditionally renders "Manage" and "Make private" buttons only when isAdminRole() is true. ProjectUsageAndSharing gates the InviteMemberCard similarly. Both components now import and apply the isAdminRole check against useWorkspace().

Changes

Admin-only project sharing UI access control

Layer / File(s) Summary
ProjectSharingStrip admin-gated action buttons
echo/frontend/src/components/project/ProjectSharingStrip.tsx
Imports useWorkspace and isAdminRole, calls useWorkspace() to fetch role, and wraps both the "Manage" button (in visibility="private" state) and "Make private" button (in visibility="workspace" state) with isAdminRole(workspace?.role) guards.
ProjectUsageAndSharing invite card role gating
echo/frontend/src/components/project/ProjectUsageAndSharing.tsx
Imports isAdminRole and gates InviteMemberCard rendering so it appears only for private projects when the user holds an admin role; label and helper text are no longer conditional on workspace visibility.

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately summarizes the main objective: restricting project sharing UI actions (Manage, Make private, and InviteMemberCard) to admin-role users only across two components.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sam/project-sharing-member-permissions

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@dembrane-sam-bot dembrane-sam-bot added this pull request to the merge queue May 27, 2026
Merged via the queue into main with commit bc73903 May 27, 2026
11 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.

2 participants