summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJames Bennett <ubernostrum@gmail.com>2011-09-11 05:47:48 +0000
committerJames Bennett <ubernostrum@gmail.com>2011-09-11 05:47:48 +0000
commit4224127b54a7faa31da00b8eb1d2f04eb8aa0746 (patch)
tree77eca37d928b3113492a16d3220d25d90db8a4f1 /docs
parentf6d11f9b05b0f5c14f6e179b800d55ecf1c1a0f7 (diff)
Fixed #16094: Added clear example of how to refer to custom permissions.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16813 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
-rw-r--r--docs/topics/auth.txt11
1 files changed, 7 insertions, 4 deletions
diff --git a/docs/topics/auth.txt b/docs/topics/auth.txt
index cac22e636e..285406eafc 100644
--- a/docs/topics/auth.txt
+++ b/docs/topics/auth.txt
@@ -1384,16 +1384,19 @@ can or cannot do with Task instances, specific to your application::
...
class Meta:
permissions = (
- ("can_view", "Can see available tasks"),
- ("can_change_status", "Can change the status of tasks"),
- ("can_close", "Can remove a task by setting its status as closed"),
+ ("view_task", "Can see available tasks"),
+ ("change_task_status", "Can change the status of tasks"),
+ ("close_task", "Can remove a task by setting its status as closed"),
)
The only thing this does is create those extra permissions when you run
:djadmin:`manage.py syncdb <syncdb>`. Your code is in charge of checking the
value of these permissions when an user is trying to access the functionality
provided by the application (viewing tasks, changing the status of tasks,
-closing tasks.)
+closing tasks.) Continuing the above example, the following checks if a user may
+view tasks:
+
+ user.has_perm('app.view_task')
API reference
-------------