chore: format
This commit is contained in:
1 parent
39777e35d8
commit
c951b4f262
69 files changed
+143
-29
No files matched your search
@@ -425,15 +425,12 @@ async def get_model_by_id(id: str, user=Depends(get_verified_user), db: AsyncSes
|
||||
)
|
||||
)
|
||||
|
||||
if (
|
||||
write_access
|
||||
or await AccessGrants.has_access(
|
||||
user_id=user.id,
|
||||
resource_type='model',
|
||||
resource_id=model.id,
|
||||
permission='read',
|
||||
db=db,
|
||||
)
|
||||
if write_access or await AccessGrants.has_access(
|
||||
user_id=user.id,
|
||||
resource_type='model',
|
||||
resource_id=model.id,
|
||||
permission='read',
|
||||
db=db,
|
||||
):
|
||||
model_dict = model.model_dump()
|
||||
# Strip params (system prompt and other admin-curated config)
|
||||
|
||||
@@ -484,9 +484,7 @@ async def update_tools_by_id(
|
||||
if form_data.content != tools.content:
|
||||
if user.role != 'admin' and not (
|
||||
await has_permission(user.id, 'workspace.tools', request.app.state.config.USER_PERMISSIONS, db=db)
|
||||
or await has_permission(
|
||||
user.id, 'workspace.tools_import', request.app.state.config.USER_PERMISSIONS, db=db
|
||||
)
|
||||
or await has_permission(user.id, 'workspace.tools_import', request.app.state.config.USER_PERMISSIONS, db=db)
|
||||
):
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_401_UNAUTHORIZED,
|
||||
|
||||
Reference in new issue
Block a user