Add toggle to read/write perms on access control

This commit is contained in:
tarmst committed 2025-01-10 18:44:50 +00:00
1 parent cd20c578d2
commit 49eca68e28
5 files changed
+39 -7

No files matched your search

+2 -1
View File
@@ -165,7 +165,8 @@ async def update_tools_by_id(
detail=ERROR_MESSAGES.NOT_FOUND,
)
if tools.user_id != user.id and user.role != "admin":
# Is the user the original creator, in a group with write access, or an admin
if tools.user_id != user.id and not has_access(user.id, "write", tools.access_control) and user.role != "admin":
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail=ERROR_MESSAGES.UNAUTHORIZED,