Ticket #16094: patch 2.diff
File patch 2.diff, 1.2 KB (added by , 13 years ago) |
---|
-
docs/topics/auth.txt
1384 1384 ... 1385 1385 class Meta: 1386 1386 permissions = ( 1387 (" can_view", "Can see available tasks"),1388 ("c an_change_status", "Can change the status of tasks"),1389 ("c an_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"), 1390 1390 ) 1391 1391 1392 1392 The only thing this does is create those extra permissions when you run 1393 1393 :djadmin:`manage.py syncdb <syncdb>`. Your code is in charge of checking the 1394 1394 value of these permissions when an user is trying to access the functionality 1395 1395 provided by the application (viewing tasks, changing the status of tasks, 1396 closing tasks.) 1396 closing tasks.) Continuing the above example, the following checks if a user may 1397 view tasks:: 1397 1398 1399 user.has_perm('app.view_task') 1400 1398 1401 API reference 1399 1402 ------------- 1400 1403