示例#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')