Exemple #1
0
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')
            })
Exemple #2
0
def ValidateDirectorRole(role):
    if not role & const.corpRoleDirector:
        raise UserError(
            'CrpAccessDenied', {
                'reason': (const.UE_LOC,
                           'UI/Corporations/AccessRestrictions/NotDirector')
            })
Exemple #3
0
def ValidateAccountantOrJuniorAccountantRole(role):
    if not role & (const.corpRoleAccountant | const.corpRoleJuniorAccountant):
        raise UserError(
            'CrpAccessDenied', {
                'reason': (const.UE_LOC,
                           'UI/Corporations/AccessRestrictions/NotAccountant')
            })