50 lines
1.4 KiB
JavaScript
50 lines
1.4 KiB
JavaScript
|
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',
|
||
|
],
|
||
|
},
|
||
|
|
||
|
post: {
|
||
|
'/policy': [
|
||
|
['middleware::api:Permission', { check: 'v1:iam:policy:create' }],
|
||
|
'controller::api:v1:IAM.create_policy',
|
||
|
],
|
||
|
'/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',
|
||
|
],
|
||
|
},
|
||
|
|
||
|
delete: {
|
||
|
'/policy/:id': [
|
||
|
['middleware::api:Permission', { check: 'v1:iam:policy:delete' }],
|
||
|
'controller::api:v1:IAM.delete_policy',
|
||
|
],
|
||
|
},
|
||
|
}
|
||
|
|
||
|
module.exports = exports = iam_routes
|