diff options
| author | Berker Peksag <berker.peksag@gmail.com> | 2016-09-23 22:28:32 +0300 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-09-23 15:28:47 -0400 |
| commit | 69839e97b9f1e0fc402b330d73d4c482f0d38caa (patch) | |
| tree | 870f29511aa6b9ccd78058fcc6a4528df8ccd3d3 | |
| parent | 90949a156a2a7b67b52db4b2b53776a7016fda09 (diff) | |
[1.10.x] Simplified has_perm() example in topics/auth/customizing.txt.
Backport of 0a6ed6b1d9dadd0916e887ff9026cf206be36a5c from master
| -rw-r--r-- | docs/topics/auth/customizing.txt | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/docs/topics/auth/customizing.txt b/docs/topics/auth/customizing.txt index 6d84759831..cec98fc7a5 100644 --- a/docs/topics/auth/customizing.txt +++ b/docs/topics/auth/customizing.txt @@ -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 |
