do not allow removing any permissions from last and only user #2462

Closed
opened 2025-12-29 18:19:04 +01:00 by adam · 4 comments
Owner

Originally created by @fawaf on GitHub (Mar 14, 2019).

Environment

  • Python version: 3.6.8
  • NetBox version: 2.5.8

Steps to Reproduce

  1. go to admin interface
  2. click on admin superuser
  3. uncheck "superuser status", "staff", and/or "active"
  4. save

Expected Behavior

error message to show operation is not allowed

Observed Behavior

operation allowed and locked out of superuser

Originally created by @fawaf on GitHub (Mar 14, 2019). <!-- NOTE: This form is only for reproducible bugs. If you need assistance with NetBox installation, or if you have a general question, DO NOT open an issue. Instead, post to our mailing list: https://groups.google.com/forum/#!forum/netbox-discuss Please describe the environment in which you are running NetBox. Be sure that you are running an unmodified instance of the latest stable release before submitting a bug report. --> ### Environment * Python version: <!-- Example: 3.5.4 -->3.6.8 * NetBox version: <!-- Example: 2.5.2 -->2.5.8 <!-- Describe in detail the exact steps that someone else can take to reproduce this bug using the current stable release of NetBox (or the current beta release where applicable). Begin with the creation of any necessary database objects and call out every operation being performed explicitly. If reporting a bug in the REST API, be sure to reconstruct the raw HTTP request(s) being made: Don't rely on a wrapper like pynetbox. --> ### Steps to Reproduce 1. go to admin interface 2. click on admin superuser 3. uncheck "superuser status", "staff", and/or "active" 4. save <!-- What did you expect to happen? --> ### Expected Behavior error message to show operation is not allowed <!-- What happened instead? --> ### Observed Behavior operation allowed and locked out of superuser
adam closed this issue 2025-12-29 18:19:05 +01:00
Author
Owner

@jeremystretch commented on GitHub (Mar 14, 2019):

This is a purely operational concern and not something on which NetBox takes a stance. If you need to create a new superuser account, this can be done at the command line: manage.py createsuperuser. Please refer to the Django documentation for details.

@jeremystretch commented on GitHub (Mar 14, 2019): This is a purely operational concern and not something on which NetBox takes a stance. If you need to create a new superuser account, this can be done at the command line: `manage.py createsuperuser`. Please refer to the [Django documentation](https://docs.djangoproject.com/en/2.1/ref/django-admin/#createsuperuser) for details.
Author
Owner

@fawaf commented on GitHub (Mar 14, 2019):

just to make sure, it is expected behavior that if there was only one user left in netbox and superuser/staff/active status is revoked, to be locked out of the ui?

@fawaf commented on GitHub (Mar 14, 2019): just to make sure, it is expected behavior that if there was only one user left in netbox and superuser/staff/active status is revoked, to be locked out of the ui?
Author
Owner

@fawaf commented on GitHub (Mar 14, 2019):

@jeremystretch

@fawaf commented on GitHub (Mar 14, 2019): @jeremystretch
Author
Owner

@DanSheps commented on GitHub (Mar 15, 2019):

This is expected

@DanSheps commented on GitHub (Mar 15, 2019): This is expected
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#2462