def notice(): perm = ActionNeedPermission('flightlog', Finish) can = perm.can() return { 'flight_log_notices': get_flightlog_unsubmit(perm=can), 'can_flight_notices': can, }
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
def can_view_details_flightlog(self): return ActionNeedPermission('flightlog', View).can()
def can_edit_flightlog(self): return ActionNeedPermission('flightlog', Edit).can()
def can_delete_flightlog(self): return ActionNeedPermission('flightlog', Delete).can()
def can_remove_status(self): perm = ActionNeedPermission(self._action_name, RemoveBoundStatus) return perm.can()
def can_create_flightlog(self): return ActionNeedPermission('flightlog', Create).can()
def can_lend(self): perm = ActionNeedPermission( LendApplication.__name__.lower(), Create) return perm.can()
def can_edit_status(self): perm = ActionNeedPermission(self._action_name, EditBoundStatus) return perm.can()
def can_routine_work(self): perm = ActionNeedPermission('routinework', 'create') return perm.can()
def can_aircraft(self): perm = ActionNeedPermission('aircraft', View) return perm.can()
def can_finish(self): perm = ActionNeedPermission(self._view._action_name, Finish) return perm.can()
def is_accessible(self): return ActionNeedPermission('flightlog', View).can()
def can_borrowing_return(self): perm = ActionNeedPermission( BorrowingInReturnModel.__name__.lower(), Create) return perm.can()
def can_repair(self): perm = ActionNeedPermission( RepairApplication.__name__.lower(), Create) return perm.can()
def can_scrap(self): perm = ActionNeedPermission(Scrap.__name__.lower(), Create) return perm.can()
def can_assemble(self): perm = ActionNeedPermission( AssembleApplication.__name__.lower(), Create) return perm.can()
def can_loan(self): perm = ActionNeedPermission( LoanApplicationOrder.__name__.lower(), Create) return perm.can()
def is_accessible(self): return ActionNeedPermission('formulastat', View).can()
def can_view_aircraft(): return ActionNeedPermission('aircraft', View).can()
def is_accessible(self): return ActionNeedPermission('expirewarning', View).can()
def can_purchase(self): perm = ActionNeedPermission( PurchaseApplication.__name__.lower(), Create) return perm.can()