Ticket #16094: patch 2.diff

File patch 2.diff, 1.2 KB (added by bradley.ayers, 13 years ago)

fixed the code-block

  • docs/topics/auth.txt

     
    13841384        ...
    13851385        class Meta:
    13861386            permissions = (
    1387                 ("can_view", "Can see available tasks"),
    1388                 ("can_change_status", "Can change the status of tasks"),
    1389                 ("can_close", "Can remove a task by setting its status as closed"),
     1387                ("view_task", "Can see available tasks"),
     1388                ("change_task_status", "Can change the status of tasks"),
     1389                ("close_task", "Can remove a task by setting its status as closed"),
    13901390            )
    13911391
    13921392The only thing this does is create those extra permissions when you run
    13931393:djadmin:`manage.py syncdb <syncdb>`. Your code is in charge of checking the
    13941394value of these permissions when an user is trying to access the functionality
    13951395provided by the application (viewing tasks, changing the status of tasks,
    1396 closing tasks.)
     1396closing tasks.) Continuing the above example, the following checks if a user may
     1397view tasks::
    13971398
     1399    user.has_perm('app.view_task')
     1400
    13981401API reference
    13991402-------------
    14001403
Back to Top