"""V2Role-related constants.""" from permissions.constants import application, constants # Assumes one role per profile PROFILE_TO_V2_ROLE_MAP = { constants.AUDIENCEPROFILE: application.FANSIFTER_BASE_ROLE, constants.COLLABORATORSPROFILE: application.COLLABORATORS_BASE_ROLE, constants.DOCUMENTSPROFILE: application.BANKING_TAX_BASE_ROLE, constants.INSIGHTSPROFILE: application.INSIGHTS_BASE_ROLE, constants.MONEYHUBPROFILE: application.CUSTOMER_ACCOUNTING_BASE_ROLE, constants.SETTINGSPROFILE: application.SETTINGS_BASE_ROLE, constants.SONGWHIPPROFILE: application.SONGWHIP_READ_ROLE, } # A trimmed down version of constants.PROFILE_TYPE_TO_ROLES_MAPPING # for assignment via Settings v2/SEAT PROFILE_TO_NEO4J_ROLE_MAP = { # 'fansifter_can_view_fan_data' becomes 'audience' when written constants.AUDIENCEPROFILE: constants.AUDIENCE_ROLE, constants.COLLABORATORSPROFILE: constants.ROYALTIES_ROLE, constants.DOCUMENTSPROFILE: constants.PAYEE_MANAGEMENT_ROLE, constants.INSIGHTSPROFILE: constants.ANALYTICS_ROLE, constants.MONEYHUBPROFILE: constants.ACCOUNTING_ROLE, # 'songwhip_read' becomes 'songwhip' when written constants.SONGWHIPPROFILE: constants.SONGWHIP_ROLE, } LABEL_PROFILE_ROLES_TO_V2_ROLES_MAP = { constants.ADMINISTRATOR_ROLE: application.WORKSTATION_ADMIN_ROLE, constants.ADVERTISING_ROLE: application.WORKSTATION_ADVERTISING_ROLE, constants.ANALYTICS_ROLE: application.WORKSTATION_ANALYTICS_BASE_ROLE, constants.CATALOG_ROLE: application.WORKSTATION_CATALOG_ROLE, constants.MARKETING_ROLE: application.WORKSTATION_MARKETING_ROLE, } V2_ROLE_TO_PROFILE_MAP = { **{value: key for key, value in PROFILE_TO_V2_ROLE_MAP.items()}, **{value: constants.LABELPROFILE for value in LABEL_PROFILE_ROLES_TO_V2_ROLES_MAP.values()}, } V2_ROLE_TO_LABEL_PROFILE_ROLE_MAP = { value: key for key, value in LABEL_PROFILE_ROLES_TO_V2_ROLES_MAP.items() }