mirror of
https://github.com/fastapi-admin/fastapi-admin.git
synced 2025-08-14 10:47:30 +08:00
Fix style
This commit is contained in:
@ -139,7 +139,7 @@ class HasPermission:
|
||||
|
||||
async def __call__(self, resource: str = Path(...), user=Depends(get_current_user)):
|
||||
if not app.permission or user.is_superuser:
|
||||
return True #Hmm. Should superuser really cirumvent all permission checks. not a good practice!?!?!?!!?!!!
|
||||
return True # Hmm. Should superuser really cirumvent all permission checks. not a good practice!?!?!?!!?!!!
|
||||
if not user.is_active:
|
||||
return False
|
||||
has_permission = False
|
||||
@ -154,4 +154,4 @@ class HasPermission:
|
||||
has_read_permission = HasPermission(action=enums.PermissionAction.read)
|
||||
has_create_permission = HasPermission(action=enums.PermissionAction.create)
|
||||
has_update_permission = HasPermission(action=enums.PermissionAction.update)
|
||||
has_delete_permission = HasPermission(action=enums.PermissionAction.delete)
|
||||
has_delete_permission = HasPermission(action=enums.PermissionAction.delete)
|
||||
|
Reference in New Issue
Block a user