#23559: Staff (not superusers) should not manage perms of Users
-------------------------------+------------------------------------
     Reporter:  Tuttle         |                    Owner:  nobody
         Type:  New feature    |                   Status:  new
    Component:  Documentation  |                  Version:
     Severity:  Normal         |               Resolution:
     Keywords:                 |             Triage Stage:  Accepted
    Has patch:  0              |      Needs documentation:  1
  Needs tests:  0              |  Patch needs improvement:  0
Easy pickings:  1              |                    UI/UX:  0
-------------------------------+------------------------------------

Comment (by Tuttle):

 It was only a sketch from me, but thanks for the security audit. :-)
 That's something not immediately apparent.

 In my project I also add this to prevent staff user to edit other users
 who possibly have any permission:

 {{{#!python
 def has_change_permission(self, request, obj=None):
     has = super(MyUserAdmin, self).has_change_permission(request, obj)
     if obj and not request.user.is_superuser:
         if obj != request.user:
             if obj.is_superuser or obj.groups.exists() or
 obj.user_permissions.exists():
                 has = False

     return has
 }}}

 Indeed, while this depends on how particular project manages users and
 their perms, I still humbly think there's an idea in it worth spreading.

--
Ticket URL: <https://code.djangoproject.com/ticket/23559#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.05407ade57670bdda278e140e64b0fcf%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to