#15915: Permission codename duplication is not handled well
--------------------------------------+------------------------------
               Reporter:  valyagolev  |          Owner:  nobody
                   Type:  Bug         |         Status:  new
              Milestone:              |      Component:  contrib.auth
                Version:  1.3         |       Severity:  Normal
             Resolution:              |       Keywords:
           Triage Stage:  Accepted    |      Has patch:  0
    Needs documentation:  0           |    Needs tests:  0
Patch needs improvement:  0           |  Easy pickings:  1
--------------------------------------+------------------------------

Comment (by carljm):

 Replying to [comment:5 valyagolev]:
 > We are using row-level permissions, and we needed several: "edit_page",
 "view_page", "delete_page", "act_as_page" etc. So we have just written
 them all down in "class Meta:", and got the error.
 >
 > If Django will restrict re-stating permissions, we have two choices:
 >
 >   * Either delete/comment out "edit" and "delete" permissions, and try
 to remember or make notes about them.
 >   * add our prefix to permissions, which will lead to duplicating
 permissions: "edit_page" and "ourproject_edit_page"
 >
 > I don't like either of them.

 If I understand right, you're requesting as a new feature that you be
 allowed to explicitly define a permission in Meta with the same codename
 as a built-in permission, and your name for it will replace the default
 one, with no error?

 I don't have much opinion on that; it doesn't seem like a terrible thing
 to just use the built-in ones as-is (with a comment in Meta to remind you
 of them, if you need that), but I also don't see any huge problems with
 your proposal.

 In any case, let's keep this ticket for the better-error-message only,
 which is a separate issue that should be fixed regardless of your feature
 request (for instance, if someone defines two perms explicitly in Meta
 with the same codename, this almost certainly is an error in their code
 and should be flagged rather than letting one silently override the
 other). You can file a separate ticket for your feature request, and
 perhaps post to django-developers to point to the ticket and clarify
 exactly what it is you're requesting so others can comment.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/15915#comment:8>
Django <http://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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to