Пример #1
0
 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")
Пример #2
0
 def can_edit(self):
     return current_user and current_user.is_allowed(self.endpoint, "edit")
Пример #3
0
 def can_delete(self):
     return current_user and current_user.is_allowed(self.endpoint, "delete")
Пример #4
0
 def can_view(self):
     return current_user and current_user.is_allowed(self.endpoint, "view")
Пример #5
0
 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')
Пример #6
0
 def can_delete(self):
     return current_user and current_user.is_allowed(
         self.endpoint, 'delete')
Пример #7
0
 def can_edit(self):
     return current_user and current_user.is_allowed(self.endpoint, 'edit')
Пример #8
0
 def can_view(self):
     return current_user and current_user.is_allowed(self.endpoint, 'view')