Skip to content

Conversation

Dhanus3133
Copy link
Contributor

@Dhanus3133 Dhanus3133 commented Aug 23, 2025

What does this PR do?

This PR fixes incorrect behavior where members without the proper role could perform member management actions.

Changes made:

  • Disabled Add user button for non-Owner/Admin users.
  • Disabled Cancel invitation option in the member modal for non-Owner/Admin users.
  • Disabled Remove member option in the member modal for non-Owner/Admin users.
  • Disabled Edit roles option in the member modal for non-Owner/Admin users.
  • Restricted access to the Edit Members page for non-Owner/Admin users.

The fix includes both UI restrictions and action-level checks. While hiding buttons in the UI prevents accidental misuse, enforcing role validation at the action level ensures security even if a user tries to bypass the UI by inspecting dev tools and manually enabling restricted options.

Visual Demo (For contributors especially)

image image

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

Copy link

vercel bot commented Aug 23, 2025

@Dhanus3133 is attempting to deploy a commit to the Comp AI Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

vercel bot commented Aug 25, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
app Ready Ready Preview Comment Aug 25, 2025 1:49pm
portal Ready Ready Preview Comment Aug 25, 2025 1:49pm

@Marfuen Marfuen merged commit ddb4bb2 into trycompai:main Aug 25, 2025
3 checks passed
@Dhanus3133 Dhanus3133 deleted the fix/restrict-member-management branch August 25, 2025 14: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.

[BUG] - Falsely shows success for member role update
2 participants