from .iam_constant import (
    PRINCIPAL_TYPE_USER,
    PRINCIPAL_TYPE_ADMIN,
    PRINCIPAL_TYPE_SUBADMIN,
    PRINCIPAL_SOURCE_APP,
    PRINCIPAL_SOURCE_WEB,
    PRINCIPAL_SOURCE_GOOGLE,
    PRINCIPAL_SOURCE_APPLE,
    ACTION_CREATE,
    ACTION_READ,
    ACTION_UPDATE,
    ACTION_DELETE,
    RESOURCE_MANAGE_DASHBOARD,
    RESOURCE_MANAGE_IAM,
    RESOURCE_MANAGE_USER,
    RESOURCE_MANAGE_SUPPORT,
    RESOURCE_MANAGE_CONTACT_US,
    RESOURCE_MANAGE_FEEDBACK,
    RESOURCE_MANAGE_NOTIFICATION,
    RESOURCE_MANAGE_CMS,
    RESOURCE_MANAGE_FAQS,
    RESOURCE_MANAGE_T_C,
    RESOURCE_MANAGE_PRIVACYPOLICY,
    RESOURCE_IAM_PRINCIPAL,
    RESOURCE_IAM_PRINCIPAL_GROUP,
    RESOURCE_IAM_GROUP,
    RESOURCE_IAM_ROLE,
)

from .models import IAmPrincipal

def iam_constants_context(request):
    return {
        'iam_constants_context': {
            'PRINCIPAL_TYPE_USER': PRINCIPAL_TYPE_USER,
            'PRINCIPAL_TYPE_ADMIN': PRINCIPAL_TYPE_ADMIN,
            'PRINCIPAL_TYPE_SUBADMIN': PRINCIPAL_TYPE_SUBADMIN,
            'PRINCIPAL_SOURCE_APP': PRINCIPAL_SOURCE_APP,
            'PRINCIPAL_SOURCE_WEB': PRINCIPAL_SOURCE_WEB,
            'PRINCIPAL_SOURCE_GOOGLE': PRINCIPAL_SOURCE_GOOGLE,
            'PRINCIPAL_SOURCE_APPLE': PRINCIPAL_SOURCE_APPLE,
            'ACTION_CREATE': ACTION_CREATE,
            'ACTION_READ': ACTION_READ,
            'ACTION_UPDATE': ACTION_UPDATE,
            'ACTION_DELETE': ACTION_DELETE,
            'RESOURCE_MANAGE_DASHBOARD': RESOURCE_MANAGE_DASHBOARD,
            'RESOURCE_MANAGE_IAM': RESOURCE_MANAGE_IAM,
            'RESOURCE_MANAGE_USER': RESOURCE_MANAGE_USER,
            'RESOURCE_MANAGE_SUPPORT': RESOURCE_MANAGE_SUPPORT,
            'RESOURCE_MANAGE_CONTACT_US': RESOURCE_MANAGE_CONTACT_US,
            'RESOURCE_MANAGE_FEEDBACK': RESOURCE_MANAGE_FEEDBACK,
            'RESOURCE_MANAGE_NOTIFICATION': RESOURCE_MANAGE_NOTIFICATION,
            'RESOURCE_MANAGE_CMS': RESOURCE_MANAGE_CMS,
            'RESOURCE_MANAGE_FAQS': RESOURCE_MANAGE_FAQS,
            'RESOURCE_MANAGE_T_C': RESOURCE_MANAGE_T_C,
            'RESOURCE_MANAGE_PRIVACYPOLICY': RESOURCE_MANAGE_PRIVACYPOLICY,
            'RESOURCE_IAM_PRINCIPAL': RESOURCE_IAM_PRINCIPAL,
            'RESOURCE_IAM_PRINCIPAL_GROUP': RESOURCE_IAM_PRINCIPAL_GROUP,
            'RESOURCE_IAM_GROUP': RESOURCE_IAM_GROUP,
            'RESOURCE_IAM_ROLE': RESOURCE_IAM_ROLE,
        }
    }
