#28156: User.has_perm always returns False for a custom permission inherited 
from
group
-----------------------------------------+-----------------------------
               Reporter:  V.Korol        |          Owner:  nobody
                   Type:  Uncategorized  |         Status:  new
              Component:  contrib.auth   |        Version:  1.8
               Severity:  Normal         |       Keywords:  permissions
           Triage Stage:  Unreviewed     |      Has patch:  0
    Needs documentation:  0              |    Needs tests:  0
Patch needs improvement:  0              |  Easy pickings:  0
                  UI/UX:  0              |
-----------------------------------------+-----------------------------
 I define a custom permission in one of my models (in application called
 'tasks'):

 {{{
 class Task ( models.Model ) :
     ...
     class Meta :
          permissions = ( ( "Can run tasks on the local server",
 "run_task_locally" ), )
 }}}

 In the admin interface, I grant this permission to one of the auth groups.
 Now, for all users, belonging to this group,  {{{user.has_perm(
 "tasks.run_task_locally" )}}} is {{{False}}}. If the permission is granted
 for each user individually (not through the group), or if it's a
 supersuser, then {{{user.has_perm}}} returns {{{True}}}.

 I do not observe this problem with standard model permissions like
 ''appname.add_modelname'' or ''appname.change_modelname''.

 Running Django 1.8.18 on Python 3.4.3 using default authentication
 backend.

--
Ticket URL: <https://code.djangoproject.com/ticket/28156>
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/050.21176d064c51a23f88e073c37f68609a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to