mirror of https://github.com/jumpserver/jumpserver
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
901 B
25 lines
901 B
3 years ago
|
# coding:utf-8
|
||
|
from rest_framework_bulk.routes import BulkRouter
|
||
|
from rest_framework_nested import routers
|
||
|
|
||
|
from .. import api
|
||
|
|
||
|
app_name = 'rbac'
|
||
|
|
||
|
|
||
|
router = BulkRouter()
|
||
|
router.register(r'roles', api.RoleViewSet, 'role')
|
||
|
router.register(r'system-roles', api.SystemRoleViewSet, 'system-role')
|
||
|
router.register(r'org-roles', api.OrgRoleViewSet, 'org-role')
|
||
|
router.register(r'role-bindings', api.RoleBindingViewSet, 'role-binding')
|
||
|
router.register(r'system-role-bindings', api.SystemRoleBindingViewSet, 'system-role-binding')
|
||
|
router.register(r'org-role-bindings', api.OrgRoleBindingViewSet, 'org-role-binding')
|
||
|
router.register(r'permissions', api.PermissionViewSet, 'permission')
|
||
|
|
||
|
role_router = routers.NestedDefaultRouter(router, r'roles', lookup='role')
|
||
|
role_router.register(r'permissions', api.RolePermissionsViewSet, 'role-permission')
|
||
|
|
||
|
urlpatterns = []
|
||
|
|
||
|
urlpatterns += router.urls + role_router.urls
|