예제 #1
0
    def is_publicable_by(self, user=None):
        if not user: return False

        # check if user has Django permissions to change object
        permission = check_user_permission_on_object(user, self)
        # if permission
        if permission['granted']: return True

        # if no permissions and no locks
        if not permission.get('locked', False):
            # check if user has EditorialBoard editor permissions on object
            pub_ctxs = self.get_publication_contexts()
            for pub_ctx in pub_ctxs:
                webpath = pub_ctx.webpath
                webpath_perms = webpath.is_publicable_by(user=user, obj=self)
                if webpath_perms: return True
        # if no permissions
        return False
예제 #2
0
 def is_lockable_by(self, user):
     item = self.contact
     permission = check_user_permission_on_object(user=user, obj=item)
     return permission['granted']
 def is_lockable_by(self, user):
     permission = check_user_permission_on_object(user, self)
     return permission['granted']
예제 #4
0
 def is_lockable_by(self, user):
     item = self.carousel_item_link.carousel_item.carousel
     permission = check_user_permission_on_object(user=user, obj=item)
     return permission['granted']