Exemplo n.º 1
0
 def notice():
     perm = ActionNeedPermission('flightlog', Finish)
     can = perm.can()
     return {
         'flight_log_notices': get_flightlog_unsubmit(perm=can),
         'can_flight_notices': can,
     }
Exemplo n.º 2
0
 def get_anno_list(self, max_count=None):
     perm = ActionNeedPermission(Announcement.__name__.lower(), View)
     if perm.can():
         items = Announcement.query.filter_by(statusName=Sented).order_by(
             'sendTime desc').limit(max_count).all()
     else:
         items = None
     return items
Exemplo n.º 3
0
 def can_view_details_flightlog(self):
     return ActionNeedPermission('flightlog', View).can()
Exemplo n.º 4
0
 def can_edit_flightlog(self):
     return ActionNeedPermission('flightlog', Edit).can()
Exemplo n.º 5
0
 def can_delete_flightlog(self):
     return ActionNeedPermission('flightlog', Delete).can()
Exemplo n.º 6
0
 def can_remove_status(self):
     perm = ActionNeedPermission(self._action_name, RemoveBoundStatus)
     return perm.can()
Exemplo n.º 7
0
 def can_create_flightlog(self):
     return ActionNeedPermission('flightlog', Create).can()
Exemplo n.º 8
0
 def can_lend(self):
     perm = ActionNeedPermission(
         LendApplication.__name__.lower(), Create)
     return perm.can()
Exemplo n.º 9
0
 def can_edit_status(self):
     perm = ActionNeedPermission(self._action_name, EditBoundStatus)
     return perm.can()
Exemplo n.º 10
0
 def can_routine_work(self):
     perm = ActionNeedPermission('routinework', 'create')
     return perm.can()
Exemplo n.º 11
0
 def can_aircraft(self):
     perm = ActionNeedPermission('aircraft', View)
     return perm.can()
Exemplo n.º 12
0
 def can_finish(self):
     perm = ActionNeedPermission(self._view._action_name, Finish)
     return perm.can()
Exemplo n.º 13
0
 def is_accessible(self):
     return ActionNeedPermission('flightlog', View).can()
Exemplo n.º 14
0
 def can_borrowing_return(self):
     perm = ActionNeedPermission(
         BorrowingInReturnModel.__name__.lower(), Create)
     return perm.can()
Exemplo n.º 15
0
 def can_repair(self):
     perm = ActionNeedPermission(
         RepairApplication.__name__.lower(), Create)
     return perm.can()
Exemplo n.º 16
0
 def can_scrap(self):
     perm = ActionNeedPermission(Scrap.__name__.lower(), Create)
     return perm.can()
Exemplo n.º 17
0
 def can_assemble(self):
     perm = ActionNeedPermission(
         AssembleApplication.__name__.lower(), Create)
     return perm.can()
Exemplo n.º 18
0
 def can_loan(self):
     perm = ActionNeedPermission(
         LoanApplicationOrder.__name__.lower(), Create)
     return perm.can()
Exemplo n.º 19
0
 def is_accessible(self):
     return ActionNeedPermission('formulastat', View).can()
Exemplo n.º 20
0
def can_view_aircraft():
    return ActionNeedPermission('aircraft', View).can()
Exemplo n.º 21
0
 def is_accessible(self):
     return ActionNeedPermission('expirewarning', View).can()
Exemplo n.º 22
0
 def can_purchase(self):
     perm = ActionNeedPermission(
         PurchaseApplication.__name__.lower(), Create)
     return perm.can()