Conversation
Add PROJECT_FAIR_SHARE element type in the Auto-only entities section to enable RBAC Creator pattern for ProjectFairShare auto sub-entity. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…combinations Add RBACElementType.PROJECT_FAIR_SHARE to the VALID_SCOPE_ENTITY_COMBINATIONS under RESOURCE_GROUP scope. This allows ProjectFairShare to be properly registered as an auto sub-entity of ResourceGroup in the RBAC system. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…use RBAC Creator Change parameter type from Creator[ProjectFairShareRow] to RBACEntityCreator[ProjectFairShareRow] and replace execute_creator() with execute_rbac_entity_creator() for proper RBAC scope association. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…sitory - Import RBACEntityCreator and execute_rbac_entity_creator from .rbac.entity_creator submodule - Add missing imports for RBACElementType and RBACElementRef in db_source.py This fixes mypy errors that prevented the RBAC Creator pattern from working correctly. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Applies the RBAC Creator pattern to ProjectFairShare, replacing the generic Creator with RBACEntityCreator to automatically create RBAC scope-entity associations.
Changes:
- Added
PROJECT_FAIR_SHAREtoRBACElementTypeenum and registered it underRESOURCE_GROUPscope - Updated
FairShareDBSourceandFairShareRepositoryto useRBACEntityCreatorandexecute_rbac_entity_creator
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/ai/backend/common/data/permission/types.py |
Added PROJECT_FAIR_SHARE enum value |
src/ai/backend/common/data/permission/scope_entity_combinations.py |
Registered under RESOURCE_GROUP scope |
src/ai/backend/manager/repositories/fair_share/db_source/db_source.py |
Switched to RBACEntityCreator and execute_rbac_entity_creator |
src/ai/backend/manager/repositories/fair_share/repository.py |
Updated parameter type to RBACEntityCreator |
changes/10022.feature.md |
Changelog entry |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…Creator Add PROJECT_FAIR_SHARE to RBACElementTypeGQL enum to stay in sync with RBACElementType. Update test_scope_entity_combinations expected set and migrate test Creator calls to RBACEntityCreator for project fair share. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: octodog <mu001@lablup.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PROJECT_FAIR_SHAREtoRBACElementTypeenum as an auto sub-entity typePROJECT_FAIR_SHAREunderRESOURCE_GROUPscope in scope entity combinationsFairShareDBSourceandFairShareRepositoryto useRBACEntityCreatorinstead ofCreatorcreate_project_fair_share()to callexecute_rbac_entity_creator()for automatic RBAC scope-entity association creationTest plan
Resolves BA-5076