Skip to content

Commit 4c8d7cd

Browse files
authored
Merge pull request #1 from jayvdb/allow-superuser-admin
middleware: Only ignore /admin if superuser
2 parents ba77131 + 73bb6d2 commit 4c8d7cd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

api_permission/middleware.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def process_request(self, request):
3535
return self._return_403_res(msg)
3636

3737
logger.debug(f"header_token is:{header_token} user: {user}, method: {method}, path: {path}")
38-
if not path.startswith('/admin/'):
38+
if not path.startswith('/admin/') or not user.is_superuser:
3939
if path.startswith(API_PREFIX):
4040
if not self._has_permission(path, user, method):
4141
res = JsonResponse({

0 commit comments

Comments
 (0)