from django.conf.urls import url

from .apis.permission_crud_api import (RoleCreation, RoleUpdate, RoleDeletion,
                                       PermisssionCreation, PermissionUpdate,
                                       PermissionDeletion, PermissionUpload,
                                       RoleUserCreation, RoleUserUpdate,
                                       RoleUserDeletion, RolePermissionUpdate,
                                       BatchRolePermissionUpdate)
from .apis.views import (RoleList, RoleUserList, RolePermissionDetail,
                         ALLRolePermissionDetail, PermissionDetail)

urlpatterns = [
    url(r'^list/role$',
        RoleList.as_view(),
        name='role_list'),
    url(r'^list/roleUser$',
        RoleUserList.as_view(),
        name='role_user_list'),
    url(r'^detail/rolePermission$',
        RolePermissionDetail.as_view(),
        name='role_permission_detail'),
    url(r'^detail/aLLRolePermission$',
        ALLRolePermissionDetail.as_view(),
        name='all_role_permission_detail'),
    url(r'^detail/permission$',
        PermissionDetail.as_view(),
        name='permission_detail'),
    url(r'^create/role$',
        RoleCreation.as_view(),
        name='role_create'),
    url(r'^update/role$',
        RoleUpdate.as_view(),
        name='role_update'),
    url(r'^delete/role$',
        RoleDeletion.as_view(),
        name='role_delete'),
    url(r'^create/permission$',
        PermisssionCreation.as_view(),
        name='permission_create'),
    url(r'^update/permission$',
        PermissionUpdate.as_view(),
        name='permission_update'),
    url(r'^delete/permission$',
        PermissionDeletion.as_view(),
        name='permission_delete'),
    url(r'^upload/permission$',
        PermissionUpload.as_view(),
        name='permission_upload'),
    url(r'^create/roleUser$',
        RoleUserCreation.as_view(),
        name='role_user_create'),
    url(r'^update/roleUser$',
        RoleUserUpdate.as_view(),
        name='role_user_update'),
    url(r'^delete/roleUser$',
        RoleUserDeletion.as_view(),
        name='role_user_delete'),
    url(r'^update/rolePermission$',
        RolePermissionUpdate.as_view(),
        name='role_permission_update'),
    url(r'^update/BatchRolePermission$',
        BatchRolePermissionUpdate.as_view(),
        name='batch_role_permission_update'),
]
