netbox(role): fix oidc integration by no longer using is_staff
Some checks failed
/ Ansible Lint (push) Failing after 1m56s
Some checks failed
/ Ansible Lint (push) Failing after 1m56s
is_staff got removed in 4.5.0. See: https://github.com/netbox-community/netbox/releases/tag/v4.5.0
This commit is contained in:
parent
a92e144cfc
commit
951ec7ebcd
1 changed files with 0 additions and 2 deletions
|
|
@ -40,7 +40,6 @@ def remove_groups(response, user, backend, *args, **kwargs):
|
||||||
def set_roles(response, user, backend, *args, **kwargs):
|
def set_roles(response, user, backend, *args, **kwargs):
|
||||||
# Remove Roles temporary
|
# Remove Roles temporary
|
||||||
user.is_superuser = False
|
user.is_superuser = False
|
||||||
user.is_staff = False
|
|
||||||
try:
|
try:
|
||||||
groups = response['groups']
|
groups = response['groups']
|
||||||
except KeyError:
|
except KeyError:
|
||||||
|
|
@ -51,5 +50,4 @@ def set_roles(response, user, backend, *args, **kwargs):
|
||||||
|
|
||||||
# Set roles is role (superuser or staff) is in groups
|
# Set roles is role (superuser or staff) is in groups
|
||||||
user.is_superuser = True if 'superusers' in groups else False
|
user.is_superuser = True if 'superusers' in groups else False
|
||||||
user.is_staff = True if 'staff' in groups else False
|
|
||||||
user.save()
|
user.save()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue