2022-11-15 08:24:53 +00:00
|
|
|
|
from django.urls import path, include
|
|
|
|
|
|
|
|
|
|
from .. import api
|
|
|
|
|
|
|
|
|
|
user_permission_urlpatterns = [
|
2022-12-01 04:02:20 +00:00
|
|
|
|
# <str:user> such as: my | self | user.id
|
|
|
|
|
# assets
|
2022-12-02 05:15:03 +00:00
|
|
|
|
path('<str:user>/assets/', api.UserAllPermedAssetsApi.as_view(),
|
2022-12-07 10:38:03 +00:00
|
|
|
|
name='user-all-assets'),
|
|
|
|
|
path('<str:user>/nodes/ungrouped/assets/', api.UserDirectPermedAssetsApi.as_view(),
|
|
|
|
|
name='user-direct-assets'),
|
|
|
|
|
path('<str:user>/nodes/favorite/assets/', api.UserFavoriteAssetsApi.as_view(),
|
|
|
|
|
name='user-favorite-assets'),
|
|
|
|
|
path('<str:user>/nodes/<uuid:node_id>/assets/', api.UserPermedNodeAssetsApi.as_view(),
|
|
|
|
|
name='user-node-assets'),
|
2022-12-01 04:02:20 +00:00
|
|
|
|
|
|
|
|
|
# nodes
|
2022-12-07 10:38:03 +00:00
|
|
|
|
path('<str:user>/nodes/', api.UserAllPermedNodesApi.as_view(),
|
|
|
|
|
name='user-all-nodes'),
|
2022-12-06 11:53:36 +00:00
|
|
|
|
path('<str:user>/nodes/children/', api.UserPermedNodeChildrenApi.as_view(),
|
2022-12-07 10:38:03 +00:00
|
|
|
|
name='user-node-children'),
|
2022-11-15 08:24:53 +00:00
|
|
|
|
|
2022-12-07 10:38:03 +00:00
|
|
|
|
# tree-asset
|
|
|
|
|
path('<str:user>/assets/tree/', api.UserDirectPermedAssetsAsTreeApi.as_view(),
|
|
|
|
|
name='user-direct-assets-as-tree'),
|
|
|
|
|
path('<str:user>/ungroup/assets/tree/', api.UserUngroupAssetsAsTreeApi.as_view(),
|
|
|
|
|
name='user-ungroup-assets-as-tree'),
|
2022-12-23 03:11:56 +00:00
|
|
|
|
|
|
|
|
|
# tree-node,不包含资产
|
2022-12-07 10:38:03 +00:00
|
|
|
|
path('<str:user>/nodes/tree/', api.UserAllPermedNodesAsTreeApi.as_view(),
|
|
|
|
|
name='user-all-nodes-as-tree'),
|
|
|
|
|
path('<str:user>/nodes/children/tree/', api.UserPermedNodeChildrenAsTreeApi.as_view(),
|
|
|
|
|
name='user-node-children-as-tree'),
|
2022-12-23 03:11:56 +00:00
|
|
|
|
|
2022-12-07 10:38:03 +00:00
|
|
|
|
# tree-node-with-asset
|
2022-12-22 09:43:03 +00:00
|
|
|
|
# 异步树
|
2022-12-01 04:02:20 +00:00
|
|
|
|
path('<str:user>/nodes/children-with-assets/tree/',
|
2022-12-07 10:38:03 +00:00
|
|
|
|
api.UserPermedNodeChildrenWithAssetsAsTreeApi.as_view(),
|
|
|
|
|
name='user-node-children-with-assets-as-tree'),
|
2022-12-23 03:11:56 +00:00
|
|
|
|
# 同步树
|
|
|
|
|
path('<str:user>/nodes/all-with-assets/tree/',
|
|
|
|
|
api.UserPermedNodesWithAssetsAsTreeApi.as_view(),
|
|
|
|
|
name='user-nodes-with-assets-as-tree'),
|
2022-12-07 15:55:56 +00:00
|
|
|
|
path('<str:user>/nodes/children-with-k8s/tree/',
|
|
|
|
|
api.UserGrantedK8sAsTreeApi.as_view(),
|
|
|
|
|
name='user-nodes-children-with-k8s-as-tree'),
|
2022-12-01 04:02:20 +00:00
|
|
|
|
# accounts
|
2022-11-16 03:29:02 +00:00
|
|
|
|
path('<str:user>/assets/<uuid:asset_id>/accounts/', api.UserPermedAssetAccountsApi.as_view(),
|
|
|
|
|
name='user-permed-asset-accounts'),
|
2022-11-15 08:24:53 +00:00
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
user_group_permission_urlpatterns = [
|
|
|
|
|
# 查询某个用户组授权的资产和资产组
|
2022-12-01 04:02:20 +00:00
|
|
|
|
path('<uuid:pk>/assets/', api.UserGroupGrantedAssetsApi.as_view(),
|
|
|
|
|
name='user-group-assets'),
|
|
|
|
|
path('<uuid:pk>/nodes/', api.UserGroupGrantedNodesApi.as_view(),
|
|
|
|
|
name='user-group-nodes'),
|
|
|
|
|
path('<uuid:pk>/nodes/children/', api.UserGroupGrantedNodesApi.as_view(),
|
|
|
|
|
name='user-group-nodes-children'),
|
2022-11-15 08:24:53 +00:00
|
|
|
|
path('<uuid:pk>/nodes/children/tree/', api.UserGroupGrantedNodeChildrenAsTreeApi.as_view(),
|
|
|
|
|
name='user-group-nodes-children-as-tree'),
|
|
|
|
|
path('<uuid:pk>/nodes/<uuid:node_id>/assets/', api.UserGroupGrantedNodeAssetsApi.as_view(),
|
|
|
|
|
name='user-group-node-assets'),
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
user_permission_urlpatterns = [
|
|
|
|
|
path('users/', include(user_permission_urlpatterns)),
|
|
|
|
|
path('user-groups/', include(user_group_permission_urlpatterns)),
|
|
|
|
|
]
|