-
Notifications
You must be signed in to change notification settings - Fork 164
feat: Add RBAC DB source #5756
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feat/add-processors-based-on-action-types
Are you sure you want to change the base?
feat: Add RBAC DB source #5756
Conversation
4f51346
to
0f600c4
Compare
bfdd80a
to
2cf1a22
Compare
3c9040b
to
8ec6b57
Compare
from ...models.utils import ExtendedAsyncSAEngine | ||
|
||
|
||
class PermissionControllerDBSource: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't seem good that the word "controller" is included in the source.
role_row = await self._get_role(data.id, db_session) | ||
if role_row is None: | ||
raise ObjectNotFound(f"Role with ID {data.id} does not exist.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better if you returned it non-Optional from the moment you read it in _get_role
.
j = ( | ||
sa.join( | ||
RoleRow, | ||
UserRoleRow, | ||
RoleRow.id == UserRoleRow.role_id, | ||
) | ||
.join( | ||
ObjectPermissionRow, | ||
RoleRow.id == ObjectPermissionRow.role_id, | ||
) | ||
.join( | ||
PermissionGroupRow, | ||
RoleRow.id == PermissionGroupRow.role_id, | ||
) | ||
.join( | ||
PermissionRow, | ||
PermissionGroupRow.id == PermissionRow.permission_group_id, | ||
) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😭
2cf1a22
to
4db5743
Compare
8ec6b57
to
bfe9e1b
Compare
Checklist: (if applicable)
ai.backend.test
docs
directory