1 2 4 7 11 13 15 18 20 23 26 30 34 38 41 42 43 44 45 47 49 50 51 52 53 56 57 59 61 63 64 66 67 70 71 74 75 77 78 79 80 82 83 |
"""Django page CMS permissions management using django-authority."""
"""Handle the :class:`Page <pages.models.Page>` permissions."""
"""Return ``True`` if the current user has permission on the page."""
return True return True return True perm = self.user.has_perm('pages.can_publish') if perm: return True return False
"""Return ``True`` if the current user has permission to change the page."""
# the user has always the right to look at a page content # if he doesn't try to modify it.
# right to change all the pages return True # try the global language permission first 'pages.can_manage_%s' % lang.replace('-', '_') ) return True # then per object permission return True # last hierarchic permissions because it's more expensive return True else: if perm_func(ancestor): return True
# everything else failed, no permissions
|