mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
refactor: update role permissions and enhance RBAC logic to include own permissions for courses and dashboard access
This commit is contained in:
parent
a1976c5423
commit
9f13884c08
8 changed files with 201 additions and 31 deletions
|
|
@ -16,14 +16,36 @@ class Permission(BaseModel):
|
|||
return getattr(self, item)
|
||||
|
||||
|
||||
class PermissionsWithOwn(BaseModel):
|
||||
action_create: bool
|
||||
action_read: bool
|
||||
action_read_own: bool
|
||||
action_update: bool
|
||||
action_update_own: bool
|
||||
action_delete: bool
|
||||
action_delete_own: bool
|
||||
|
||||
def __getitem__(self, item):
|
||||
return getattr(self, item)
|
||||
|
||||
|
||||
class DashboardPermission(BaseModel):
|
||||
action_access: bool
|
||||
|
||||
def __getitem__(self, item):
|
||||
return getattr(self, item)
|
||||
|
||||
|
||||
class Rights(BaseModel):
|
||||
courses: Permission
|
||||
courses: PermissionsWithOwn
|
||||
users: Permission
|
||||
usergroups : Permission
|
||||
collections: Permission
|
||||
organizations: Permission
|
||||
coursechapters: Permission
|
||||
activities: Permission
|
||||
roles: Permission
|
||||
dashboard: DashboardPermission
|
||||
|
||||
def __getitem__(self, item):
|
||||
return getattr(self, item)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue