Skip to content

Conversation

antcybersec
Copy link

Allows org owners/admins to see the edit (ellipsis) menu on their own row by permitting self-edit when user is admin/owner. Changes limited to UserListTable.tsx and MemberList.tsx. Fixes #24377.

…rnames

- Fix UserListTable to show edit option for org owners/admins on themselves
- Fix MemberList to show edit option for org owners/admins on themselves
- Resolves issue where org owners/admins couldn't see triple dot menu to edit their own usernames
- Maintains existing security by only allowing edit for users with proper permissions

Fixes calcom#24377
Copy link

vercel bot commented Oct 9, 2025

@antcybersec is attempting to deploy a commit to the cal Team on Vercel.

A member of the Team first needs to authorize it.

@graphite-app graphite-app bot added the community Created by Linear-GitHub Sync label Oct 9, 2025
@graphite-app graphite-app bot requested a review from a team October 9, 2025 06:32
@github-actions github-actions bot added organizations area: organizations, orgs ✨ feature New feature or request labels Oct 9, 2025
@dosubot dosubot bot added teams area: teams, round robin, collective, managed event-types 🐛 bug Something isn't working labels Oct 9, 2025
Copy link
Contributor

coderabbitai bot commented Oct 9, 2025

Walkthrough

Updates adjust edit-permission logic so that edit actions are allowed when the row is not the current user, or when the current user is an Org Admin/Owner (enabling self-edit for admins/owners). Minor refactors include renaming local variables with leading underscores and adding braces around certain switch-case sections without altering behavior. No exported or public API signatures are changed. These modifications appear across member and user list components.

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Out of Scope Changes Check ⚠️ Warning In addition to the permission logic updates, the pull request introduces unrelated formatting changes and unused variable renames in both UserListTable.tsx and MemberList.tsx that do not contribute to enabling org owners and admins to self-edit their rows. Please remove or isolate the formatting-only switch-case braces and unused variable renames into a separate refactoring commit or PR to keep this change focused on the self-edit permission fix.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title clearly summarizes the primary change by indicating that organization owners and admins will now be able to edit their own user entries, directly reflecting the main objective of the PR.
Linked Issues Check ✅ Passed The pull request updates the edit-permission conditions in both MemberList.tsx and UserListTable.tsx to allow organization owners and admins to see and interact with the edit menu on their own rows, thereby directly addressing issue #24377’s requirement to enable self-editing for these roles.
Description Check ✅ Passed The description clearly explains that the change enables org owners and admins to access the edit menu on their own rows, specifies the affected files, and references the linked issue.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between bf89991 and 72f57ee.

📒 Files selected for processing (2)
  • packages/features/ee/teams/components/MemberList.tsx (3 hunks)
  • packages/features/users/components/UserTable/UserListTable.tsx (4 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.tsx

📄 CodeRabbit inference engine (.cursor/rules/review.mdc)

Always use t() for text localization in frontend code; direct text embedding should trigger a warning

Files:

  • packages/features/ee/teams/components/MemberList.tsx
  • packages/features/users/components/UserTable/UserListTable.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/review.mdc)

Flag excessive Day.js use in performance-critical code; prefer native Date or Day.js .utc() in hot paths like loops

Files:

  • packages/features/ee/teams/components/MemberList.tsx
  • packages/features/users/components/UserTable/UserListTable.tsx
**/*.{ts,tsx,js,jsx}

⚙️ CodeRabbit configuration file

Flag default exports and encourage named exports. Named exports provide better tree-shaking, easier refactoring, and clearer imports. Exempt main components like pages, layouts, and components that serve as the primary export of a module.

Files:

  • packages/features/ee/teams/components/MemberList.tsx
  • packages/features/users/components/UserTable/UserListTable.tsx
⏰ Context from checks skipped due to timeout of 180000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Tests / Unit
  • GitHub Check: Type check / check-types
  • GitHub Check: Linters / lint
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (4)
packages/features/ee/teams/components/MemberList.tsx (2)

436-437: LGTM! Correctly enables self-edit for org admins/owners.

The updated editMode logic now permits org admins and owners to edit their own member row while still preventing regular members from editing themselves. The condition (!isSelf || props.isOrgAdminOrOwner) correctly implements the requirement.


690-690: LGTM! Correct use of underscore prefix for unused variable.

The rename to _fetchMoreOnBottomReached follows the ESLint convention for intentionally unused variables, correctly signaling that the hook is used for its side effects rather than its return value.

packages/features/users/components/UserTable/UserListTable.tsx (2)

451-451: LGTM! Correctly enables self-edit for admins/owners.

The updated canEdit permission logic now allows admins and owners to edit their own accepted user row while preventing regular users from editing themselves. This change aligns with the identical logic update in MemberList.tsx and correctly implements the PR objective.


172-172: LGTM! Correct use of underscore prefix for unused variable.

The rename to _totalRowCount follows the ESLint convention for intentionally unused variables, indicating the variable is assigned but not referenced elsewhere.


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.

Copy link
Member

@dhairyashiil dhairyashiil left a comment

Choose a reason for hiding this comment

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

Please attach before and after loom video, making it draft until then.

@dhairyashiil dhairyashiil marked this pull request as draft October 9, 2025 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 bug Something isn't working community Created by Linear-GitHub Sync ✨ feature New feature or request organizations area: organizations, orgs size/S teams area: teams, round robin, collective, managed event-types

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow org owners and admins to edit their own usernames in organizations

2 participants