def can_user_read(self, user): if self.read_permission: if user: return user.has_perm(perm_to_code(self.read_permission)) else: return False return True
def can_user_post(self, user): if user: if user.profile.get().is_valid_seabirder: return not self.post_permission or user.has_perm(perm_to_code(self.post_permission)) else: return False return False
def can_user_moderate(self, user): if user: if self.moderation_permission: return user.has_perm(perm_to_code(self.moderation_permission)) return False