mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
fix: use wildcard role associations
This commit is contained in:
parent
19b7dd650e
commit
d0de935902
2 changed files with 4 additions and 15 deletions
|
|
@ -38,9 +38,10 @@ async def verify_user_rights_with_roles(action: str, user_id: str, element_id: s
|
|||
await check_database()
|
||||
roles = learnhouseDB["roles"]
|
||||
|
||||
user_roles_cursor = roles.find({
|
||||
"linked_users": str(user_id)
|
||||
})
|
||||
# find data where user_id is in linked_users or * is in linked_users
|
||||
user_roles_cursor = roles.find({"$or": [{"linked_users": user_id}, {"linked_users": "*"}]})
|
||||
|
||||
|
||||
|
||||
user_roles = []
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue