Beispiel #1
0
 def notice():
     perm = ActionNeedPermission('flightlog', Finish)
     can = perm.can()
     return {
         'flight_log_notices': get_flightlog_unsubmit(perm=can),
         'can_flight_notices': can,
     }
Beispiel #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
Beispiel #3
0
 def can_view_details_flightlog(self):
     return ActionNeedPermission('flightlog', View).can()
Beispiel #4
0
 def can_edit_flightlog(self):
     return ActionNeedPermission('flightlog', Edit).can()
Beispiel #5
0
 def can_delete_flightlog(self):
     return ActionNeedPermission('flightlog', Delete).can()
Beispiel #6
0
 def can_remove_status(self):
     perm = ActionNeedPermission(self._action_name, RemoveBoundStatus)
     return perm.can()
Beispiel #7
0
 def can_create_flightlog(self):
     return ActionNeedPermission('flightlog', Create).can()
Beispiel #8
0
 def can_lend(self):
     perm = ActionNeedPermission(
         LendApplication.__name__.lower(), Create)
     return perm.can()
Beispiel #9
0
 def can_edit_status(self):
     perm = ActionNeedPermission(self._action_name, EditBoundStatus)
     return perm.can()
Beispiel #10
0
 def can_routine_work(self):
     perm = ActionNeedPermission('routinework', 'create')
     return perm.can()
Beispiel #11
0
 def can_aircraft(self):
     perm = ActionNeedPermission('aircraft', View)
     return perm.can()
Beispiel #12
0
 def can_finish(self):
     perm = ActionNeedPermission(self._view._action_name, Finish)
     return perm.can()
Beispiel #13
0
 def is_accessible(self):
     return ActionNeedPermission('flightlog', View).can()
Beispiel #14
0
 def can_borrowing_return(self):
     perm = ActionNeedPermission(
         BorrowingInReturnModel.__name__.lower(), Create)
     return perm.can()
Beispiel #15
0
 def can_repair(self):
     perm = ActionNeedPermission(
         RepairApplication.__name__.lower(), Create)
     return perm.can()
Beispiel #16
0
 def can_scrap(self):
     perm = ActionNeedPermission(Scrap.__name__.lower(), Create)
     return perm.can()
Beispiel #17
0
 def can_assemble(self):
     perm = ActionNeedPermission(
         AssembleApplication.__name__.lower(), Create)
     return perm.can()
Beispiel #18
0
 def can_loan(self):
     perm = ActionNeedPermission(
         LoanApplicationOrder.__name__.lower(), Create)
     return perm.can()
Beispiel #19
0
 def is_accessible(self):
     return ActionNeedPermission('formulastat', View).can()
Beispiel #20
0
def can_view_aircraft():
    return ActionNeedPermission('aircraft', View).can()
Beispiel #21
0
 def is_accessible(self):
     return ActionNeedPermission('expirewarning', View).can()
Beispiel #22
0
 def can_purchase(self):
     perm = ActionNeedPermission(
         PurchaseApplication.__name__.lower(), Create)
     return perm.can()