def is_accessible(self, endpoint=None): view = endpoint or self.endpoint return self.__class__ == MainView or current_user and current_user.is_allowed(view, "view")
def can_edit(self): return current_user and current_user.is_allowed(self.endpoint, "edit")
def can_delete(self): return current_user and current_user.is_allowed(self.endpoint, "delete")
def can_view(self): return current_user and current_user.is_allowed(self.endpoint, "view")
def is_accessible(self, endpoint=None): view = endpoint or self.endpoint return self.__class__ == MainView or current_user and current_user.is_allowed( view, 'view')
def can_delete(self): return current_user and current_user.is_allowed( self.endpoint, 'delete')
def can_edit(self): return current_user and current_user.is_allowed(self.endpoint, 'edit')
def can_view(self): return current_user and current_user.is_allowed(self.endpoint, 'view')