[1.10.x] Simplified has_perm() example in topics/auth/customizing.txt.
Backport of 0a6ed6b1d9
from master
This commit is contained in:
parent
90949a156a
commit
69839e97b9
|
@ -192,10 +192,7 @@ fairly simply::
|
|||
class SettingsBackend(object):
|
||||
...
|
||||
def has_perm(self, user_obj, perm, obj=None):
|
||||
if user_obj.username == settings.ADMIN_LOGIN:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
return user_obj.username == settings.ADMIN_LOGIN
|
||||
|
||||
This gives full permissions to the user granted access in the above example.
|
||||
Notice that in addition to the same arguments given to the associated
|
||||
|
|
Loading…
Reference in New Issue