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