feat: add workspace permission control for enterprise edition#30487
feat: add workspace permission control for enterprise edition#30487GareArc wants to merge 0 commit into
Conversation
Summary of ChangesHello @GareArc, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request implements a robust workspace permission control system tailored for the enterprise edition. It introduces a new module to centralize permission checks for critical actions like inviting members and transferring workspace ownership, ensuring that both billing plan limitations and administrator-defined enterprise policies are enforced. Additionally, it exposes an API for enterprise users to query these permissions and includes comprehensive unit tests to validate the new logic. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request adds workspace permission controls for member invitations and owner transfers, which is a great enhancement for the enterprise edition. The implementation introduces new endpoints, services, and helper functions to manage these permissions. My review has identified a potential bug in the account activation flow where an incorrect workspace ID might be used, an incorrect test case that could lead to a false sense of security, and a misleading docstring in the new permission helper module. I've also pointed out a minor style improvement for code consistency. Addressing these points will improve the robustness and maintainability of the new feature.
There was a problem hiding this comment.
Pull request overview
This PR adds workspace permission control functionality for the enterprise edition, allowing administrators to control workspace features like member invitations and ownership transfers through workspace-specific policies. The implementation includes both billing plan level and enterprise policy level checks.
- Adds
WorkspacePermissionmodel and API integration with enterprise service - Implements permission helper functions that check both billing/plan and workspace policy levels
- Integrates permission checks into member invitation and ownership transfer workflows
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
api/libs/workspace_permission.py |
New helper module with permission check functions for member invites and owner transfers |
api/services/enterprise/enterprise_service.py |
Adds WorkspacePermission model and nested service class to fetch workspace permissions from enterprise API |
api/services/account_service.py |
Integrates workspace permission check into the member invitation flow |
api/controllers/console/workspace/members.py |
Adds permission check before processing member invitation requests |
api/controllers/console/auth/activate.py |
Adds secondary permission check during invitation token redemption |
api/controllers/console/wraps.py |
Updates ownership transfer decorator to use new permission check helper |
api/controllers/console/workspace/workspace.py |
Adds new API endpoint to retrieve workspace permissions for the current workspace |
api/tests/unit_tests/libs/test_workspace_permission.py |
Comprehensive unit tests covering community/enterprise editions and fail-open behavior |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
983d176 to
4a32b10
Compare
0fe2335 to
b06c7c8
Compare
Important
Fixes #<issue number>.Summary
Screenshots
Checklist
dev/reformat(backend) andcd web && npx lint-staged(frontend) to appease the lint gods