mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-27 01:36:11 -06:00
11091 fix for test
This commit is contained in:
parent
5af4b374c9
commit
b8cb27601f
@ -103,8 +103,7 @@ class TokenSerializer(ValidatedModelSerializer):
|
|||||||
else:
|
else:
|
||||||
raise PermissionDenied("Unauthorized user.")
|
raise PermissionDenied("Unauthorized user.")
|
||||||
|
|
||||||
if user != grant_user:
|
if user != grant_user and not request.user.has_perm('users.grant_token'):
|
||||||
if not request.user.has_perm('users.grant_token'):
|
|
||||||
raise PermissionDenied("This user does not have permission to create tokens for other users.")
|
raise PermissionDenied("This user does not have permission to create tokens for other users.")
|
||||||
|
|
||||||
return data
|
return data
|
||||||
|
Loading…
Reference in New Issue
Block a user