def ValidateCorpWalletDivisionReadAccess(role, key): if key is None: raise UserError( 'CrpAccessDenied', { 'reason': (const.UE_LOC, 'UI/Corporations/AccessRestrictions/NoAccessToWalletDivision') }) if _CORP_WALLET_DIVISION_ROLES[key] & role == 0: raise UserError( 'CrpAccessDenied', { 'reason': (const.UE_LOC, 'UI/Corporations/AccessRestrictions/NoAccessToWalletDivision') })
def ValidateDirectorRole(role): if not role & const.corpRoleDirector: raise UserError( 'CrpAccessDenied', { 'reason': (const.UE_LOC, 'UI/Corporations/AccessRestrictions/NotDirector') })
def ValidateAccountantOrJuniorAccountantRole(role): if not role & (const.corpRoleAccountant | const.corpRoleJuniorAccountant): raise UserError( 'CrpAccessDenied', { 'reason': (const.UE_LOC, 'UI/Corporations/AccessRestrictions/NotAccountant') })