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
|
|
@ -31,7 +31,7 @@ async def create_documentpdf_activity(
|
|||
pdf_file: UploadFile | None = None,
|
||||
):
|
||||
# RBAC check
|
||||
await rbac_check(request, "activity_x", current_user, "create", db_session)
|
||||
await rbac_check(request, "course_uuid", current_user, "create", db_session)
|
||||
|
||||
# get chapter_id
|
||||
statement = select(Chapter).where(Chapter.id == chapter_id)
|
||||
|
|
@ -94,9 +94,7 @@ async def create_documentpdf_activity(
|
|||
content={
|
||||
"filename": "documentpdf." + pdf_format,
|
||||
"activity_uuid": activity_uuid,
|
||||
},
|
||||
published_version=1,
|
||||
version=1,
|
||||
},
|
||||
org_id=org_id if org_id else 0,
|
||||
course_id=coursechapter.course_id,
|
||||
activity_uuid=activity_uuid,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue