2020-05-17 04:55:08 +00:00
|
|
|
const iam_routes = {
|
|
|
|
prefix: '/api/v1/iam',
|
|
|
|
|
|
|
|
middleware: [
|
|
|
|
'auth:APIRoute'
|
|
|
|
],
|
|
|
|
|
|
|
|
get: {
|
|
|
|
'/policy': [
|
|
|
|
['middleware::api:Permission', { check: 'v1:iam:policy:list' }],
|
|
|
|
'controller::api:v1:IAM.get_policies',
|
|
|
|
],
|
|
|
|
'/policy/:id': [
|
|
|
|
['middleware::api:Permission', { check: 'v1:iam:policy:get' }],
|
|
|
|
'controller::api:v1:IAM.get_policy',
|
|
|
|
],
|
2021-04-15 15:38:43 +00:00
|
|
|
'/permission': [
|
|
|
|
['middleware::api:Permission', { check: 'v1:iam:permission:list' }],
|
|
|
|
'controller::api:v1:IAM.get_permissions',
|
|
|
|
],
|
|
|
|
'/permission/:id': [
|
|
|
|
['middleware::api:Permission', { check: 'v1:iam:permission:get' }],
|
|
|
|
'controller::api:v1:IAM.get_permission',
|
|
|
|
],
|
2020-05-17 04:55:08 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
post: {
|
|
|
|
'/policy': [
|
|
|
|
['middleware::api:Permission', { check: 'v1:iam:policy:create' }],
|
|
|
|
'controller::api:v1:IAM.create_policy',
|
|
|
|
],
|
2021-04-15 15:38:43 +00:00
|
|
|
'/permission': [
|
|
|
|
['middleware::api:Permission', { check: 'v1:iam:permission:create' }],
|
|
|
|
'controller::api:v1:IAM.create_permission',
|
|
|
|
],
|
2020-05-17 04:55:08 +00:00
|
|
|
'/check_entity_access': [
|
|
|
|
['middleware::api:Permission', { check: 'v1:iam:check_entity_access' }],
|
|
|
|
'controller::api:v1:IAM.check_entity_access',
|
|
|
|
],
|
|
|
|
'/check_user_access': [
|
|
|
|
['middleware::api:Permission', { check: 'v1:iam:check_user_access' }],
|
|
|
|
'controller::api:v1:IAM.check_user_access',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
|
|
|
|
patch: {
|
|
|
|
'/policy/:id': [
|
|
|
|
['middleware::api:Permission', { check: 'v1:iam:policy:update' }],
|
|
|
|
'controller::api:v1:IAM.update_policy',
|
|
|
|
],
|
2021-04-15 15:38:43 +00:00
|
|
|
'/permission/:id': [
|
|
|
|
['middleware::api:Permission', { check: 'v1:iam:permission:update' }],
|
|
|
|
'controller::api:v1:IAM.update_permission',
|
|
|
|
],
|
2020-05-17 04:55:08 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
delete: {
|
|
|
|
'/policy/:id': [
|
|
|
|
['middleware::api:Permission', { check: 'v1:iam:policy:delete' }],
|
|
|
|
'controller::api:v1:IAM.delete_policy',
|
|
|
|
],
|
2021-04-15 15:38:43 +00:00
|
|
|
'/permission/:id': [
|
|
|
|
['middleware::api:Permission', { check: 'v1:iam:permission:delete' }],
|
|
|
|
'controller::api:v1:IAM.delete_permission',
|
|
|
|
],
|
2020-05-17 04:55:08 +00:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = exports = iam_routes
|