Non Staff User Unable to delete devices #407

Closed
opened 2025-12-29 16:21:44 +01:00 by adam · 3 comments
Owner

Originally created by @dsolson1 on GitHub (Aug 31, 2016).

I have a user configured with security configured as "Active" and "Superuser Status" but not "Staff Status".

When this user tries to delete a device they get an error:
"You are authenticated as <username>, but are not authorized to access this page. Would you like to login to a different account?"

I have also tried to assign all user permissions without checking the "Staff Status"box and that still fails.

My goal is to have operational users accounts that can perform all of the functions but not access the Admin site.

Any suggestions?

Originally created by @dsolson1 on GitHub (Aug 31, 2016). I have a user configured with security configured as "Active" and "Superuser Status" but not "Staff Status". When this user tries to delete a device they get an error: "You are authenticated as &lt;username&gt;, but are not authorized to access this page. Would you like to login to a different account?" I have also tried to assign all user permissions without checking the "Staff Status"box and that still fails. My goal is to have operational users accounts that can perform all of the functions but not access the Admin site. Any suggestions?
adam added the type: bug label 2025-12-29 16:21:44 +01:00
adam closed this issue 2025-12-29 16:21:44 +01:00
Author
Owner

@jeremystretch commented on GitHub (Sep 1, 2016):

Superusers have all permissions implicitly. Staff status merely controls access to the admin UI. How are you attempting to delete a device?

@jeremystretch commented on GitHub (Sep 1, 2016): Superusers have all permissions implicitly. Staff status merely controls access to the admin UI. How are you attempting to delete a device?
Author
Owner

@dsolson1 commented on GitHub (Sep 1, 2016):

From the main page,
Devices -> check box in front of desired device -> Press "Delete Selected" at bottom of page -> Check Confirm box and "Confirm" button.

Then Error msg comes up.

I'm not sure why by not having the "Staff Status" checked this error would come up. Like you said, "Superuser Status" should imply all permissions within the app.

Forgot to mention that I'm running 1.5.2.

@dsolson1 commented on GitHub (Sep 1, 2016): From the main page, Devices -> check box in front of desired device -> Press "Delete Selected" at bottom of page -> Check Confirm box and "Confirm" button. Then Error msg comes up. I'm not sure why by not having the "Staff Status" checked this error would come up. Like you said, "Superuser Status" should imply all permissions within the app. Forgot to mention that I'm running 1.5.2.
Author
Owner

@jeremystretch commented on GitHub (Sep 12, 2016):

The cause of this bug was a bit of old code that's no longer needed:

@method_decorator(staff_member_required)
def dispatch(self, *args, **kwargs):
    return super(BulkDeleteView, self).dispatch(*args, **kwargs)

staff_member_required was used at some point in early development, prior to the introduction of PermissionRequiredMixin in Django 1.9, which all views now use.

@jeremystretch commented on GitHub (Sep 12, 2016): The cause of this bug was a bit of old code that's no longer needed: ``` @method_decorator(staff_member_required) def dispatch(self, *args, **kwargs): return super(BulkDeleteView, self).dispatch(*args, **kwargs) ``` `staff_member_required` was used at some point in early development, prior to the introduction of `PermissionRequiredMixin` in Django 1.9, which all views now use.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#407