Opened 8 years ago

Closed 8 years ago

#22952 closed Cleanup/optimization (duplicate)

add more detail to Django authentication system

Reported by: iamyoung001@… Owned by: nobody
Component: Documentation Version: 1.5
Severity: Normal Keywords: permission
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

the Django authentication system document should add some more detail,I'm new to Django and stucked for the document.

in the Programmatically creating permissions section,it just tells:

The permission can then be assigned to a User via its user_permissions attribute or to a Group via its permissions attribute.

I think it add more more details ,because the document is a reference,more detail is better.

it should add some code to illustrate the usage,it still has some unconspicuous aspect.

it should add codes below:

user = authenticate(username='john', password='johnpassword')
user.user_permissions.add(permission) #now the custom permission has been added to the user,but now the perssion is not visible,if we user "user.get_all_permissions()" it is still same as before,if we want to see the custom perimission in the User,we should authenticate again
user = authenticate(username='john', password='johnpassword')
user.get_all_permissions() #now we will see the custom permission we add to the user

Change History (1)

comment:1 Changed 8 years ago by Tim Graham

Resolution: duplicate
Status: newclosed

Thanks for the feedback. In version 1.6 and later of the docs, there's actually a section that follows which discusses permission caching.

If you are still using 1.5, I'd encourage you to upgrade soon as it won't receive security updates once 1.7 is released shortly.

Note: See TracTickets for help on using tickets.
Back to Top