mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
fix: various bugs & issues
This commit is contained in:
parent
a95206bd74
commit
86e7ecc0fc
15 changed files with 128 additions and 94 deletions
|
|
@ -374,6 +374,11 @@ async def verify_rights(
|
|||
|
||||
course = await courses.find_one({"course_id": course_id})
|
||||
|
||||
isAuthor = current_user.user_id in course["authors"]
|
||||
|
||||
if isAuthor:
|
||||
return True
|
||||
|
||||
if (
|
||||
current_user.user_id == "anonymous"
|
||||
and course["public"] is True
|
||||
|
|
@ -390,7 +395,7 @@ async def verify_rights(
|
|||
hasRoleRights = await verify_user_rights_with_roles(
|
||||
request, action, current_user.user_id, course_id, course["org_id"]
|
||||
)
|
||||
isAuthor = current_user.user_id in course["authors"]
|
||||
|
||||
|
||||
if not hasRoleRights and not isAuthor:
|
||||
raise HTTPException(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue