feat(backend): use manage permissions in checks
This commit is contained in:
@@ -22,19 +22,19 @@ const authorizationList = {
|
|||||||
subject: 'Flow',
|
subject: 'Flow',
|
||||||
},
|
},
|
||||||
'POST /api/v1/flows/': {
|
'POST /api/v1/flows/': {
|
||||||
action: 'create',
|
action: 'manage',
|
||||||
subject: 'Flow',
|
subject: 'Flow',
|
||||||
},
|
},
|
||||||
'PATCH /api/v1/flows/:flowId': {
|
'PATCH /api/v1/flows/:flowId': {
|
||||||
action: 'update',
|
action: 'manage',
|
||||||
subject: 'Flow',
|
subject: 'Flow',
|
||||||
},
|
},
|
||||||
'DELETE /api/v1/flows/:flowId': {
|
'DELETE /api/v1/flows/:flowId': {
|
||||||
action: 'delete',
|
action: 'manage',
|
||||||
subject: 'Flow',
|
subject: 'Flow',
|
||||||
},
|
},
|
||||||
'GET /api/v1/templates/': {
|
'GET /api/v1/templates/': {
|
||||||
action: 'create',
|
action: 'manage',
|
||||||
subject: 'Flow',
|
subject: 'Flow',
|
||||||
},
|
},
|
||||||
'GET /api/v1/steps/:stepId/connection': {
|
'GET /api/v1/steps/:stepId/connection': {
|
||||||
@@ -42,23 +42,23 @@ const authorizationList = {
|
|||||||
subject: 'Flow',
|
subject: 'Flow',
|
||||||
},
|
},
|
||||||
'PATCH /api/v1/steps/:stepId': {
|
'PATCH /api/v1/steps/:stepId': {
|
||||||
action: 'update',
|
action: 'manage',
|
||||||
subject: 'Flow',
|
subject: 'Flow',
|
||||||
},
|
},
|
||||||
'POST /api/v1/steps/:stepId/test': {
|
'POST /api/v1/steps/:stepId/test': {
|
||||||
action: 'update',
|
action: 'manage',
|
||||||
subject: 'Flow',
|
subject: 'Flow',
|
||||||
},
|
},
|
||||||
'GET /api/v1/steps/:stepId/previous-steps': {
|
'GET /api/v1/steps/:stepId/previous-steps': {
|
||||||
action: 'update',
|
action: 'manage',
|
||||||
subject: 'Flow',
|
subject: 'Flow',
|
||||||
},
|
},
|
||||||
'POST /api/v1/steps/:stepId/dynamic-fields': {
|
'POST /api/v1/steps/:stepId/dynamic-fields': {
|
||||||
action: 'update',
|
action: 'manage',
|
||||||
subject: 'Flow',
|
subject: 'Flow',
|
||||||
},
|
},
|
||||||
'POST /api/v1/steps/:stepId/dynamic-data': {
|
'POST /api/v1/steps/:stepId/dynamic-data': {
|
||||||
action: 'update',
|
action: 'manage',
|
||||||
subject: 'Flow',
|
subject: 'Flow',
|
||||||
},
|
},
|
||||||
'GET /api/v1/connections/:connectionId/flows': {
|
'GET /api/v1/connections/:connectionId/flows': {
|
||||||
@@ -66,11 +66,11 @@ const authorizationList = {
|
|||||||
subject: 'Flow',
|
subject: 'Flow',
|
||||||
},
|
},
|
||||||
'POST /api/v1/connections/:connectionId/test': {
|
'POST /api/v1/connections/:connectionId/test': {
|
||||||
action: 'update',
|
action: 'manage',
|
||||||
subject: 'Connection',
|
subject: 'Connection',
|
||||||
},
|
},
|
||||||
'POST /api/v1/connections/:connectionId/verify': {
|
'POST /api/v1/connections/:connectionId/verify': {
|
||||||
action: 'create',
|
action: 'manage',
|
||||||
subject: 'Connection',
|
subject: 'Connection',
|
||||||
},
|
},
|
||||||
'GET /api/v1/apps/:appKey/flows': {
|
'GET /api/v1/apps/:appKey/flows': {
|
||||||
@@ -94,59 +94,59 @@ const authorizationList = {
|
|||||||
subject: 'Execution',
|
subject: 'Execution',
|
||||||
},
|
},
|
||||||
'DELETE /api/v1/steps/:stepId': {
|
'DELETE /api/v1/steps/:stepId': {
|
||||||
action: 'update',
|
action: 'manage',
|
||||||
subject: 'Flow',
|
subject: 'Flow',
|
||||||
},
|
},
|
||||||
'PATCH /api/v1/connections/:connectionId': {
|
'PATCH /api/v1/connections/:connectionId': {
|
||||||
action: 'update',
|
action: 'manage',
|
||||||
subject: 'Connection',
|
subject: 'Connection',
|
||||||
},
|
},
|
||||||
'DELETE /api/v1/connections/:connectionId': {
|
'DELETE /api/v1/connections/:connectionId': {
|
||||||
action: 'delete',
|
action: 'manage',
|
||||||
subject: 'Connection',
|
subject: 'Connection',
|
||||||
},
|
},
|
||||||
'POST /api/v1/connections/:connectionId/reset': {
|
'POST /api/v1/connections/:connectionId/reset': {
|
||||||
action: 'create',
|
action: 'manage',
|
||||||
subject: 'Connection',
|
subject: 'Connection',
|
||||||
},
|
},
|
||||||
'PATCH /api/v1/flows/:flowId/status': {
|
'PATCH /api/v1/flows/:flowId/status': {
|
||||||
action: 'publish',
|
action: 'manage',
|
||||||
subject: 'Flow',
|
subject: 'Flow',
|
||||||
},
|
},
|
||||||
'POST /api/v1/flows/:flowId/duplicate': {
|
'POST /api/v1/flows/:flowId/duplicate': {
|
||||||
action: 'create',
|
action: 'manage',
|
||||||
subject: 'Flow',
|
subject: 'Flow',
|
||||||
},
|
},
|
||||||
'POST /api/v1/flows/:flowId/export': {
|
'POST /api/v1/flows/:flowId/export': {
|
||||||
action: 'update',
|
action: 'manage',
|
||||||
subject: 'Flow',
|
subject: 'Flow',
|
||||||
},
|
},
|
||||||
'POST /api/v1/flows/import': {
|
'POST /api/v1/flows/import': {
|
||||||
action: 'create',
|
action: 'manage',
|
||||||
subject: 'Flow',
|
subject: 'Flow',
|
||||||
},
|
},
|
||||||
'POST /api/v1/flows/:flowId/steps': {
|
'POST /api/v1/flows/:flowId/steps': {
|
||||||
action: 'update',
|
action: 'manage',
|
||||||
subject: 'Flow',
|
subject: 'Flow',
|
||||||
},
|
},
|
||||||
'POST /api/v1/apps/:appKey/connections': {
|
'POST /api/v1/apps/:appKey/connections': {
|
||||||
action: 'create',
|
action: 'manage',
|
||||||
subject: 'Connection',
|
subject: 'Connection',
|
||||||
},
|
},
|
||||||
'POST /api/v1/connections/:connectionId/auth-url': {
|
'POST /api/v1/connections/:connectionId/auth-url': {
|
||||||
action: 'create',
|
action: 'manage',
|
||||||
subject: 'Connection',
|
subject: 'Connection',
|
||||||
},
|
},
|
||||||
'POST /api/v1/folders/': {
|
'POST /api/v1/folders/': {
|
||||||
action: 'create',
|
action: 'manage',
|
||||||
subject: 'Flow',
|
subject: 'Flow',
|
||||||
},
|
},
|
||||||
'PATCH /api/v1/folders/:folderId': {
|
'PATCH /api/v1/folders/:folderId': {
|
||||||
action: 'create',
|
action: 'manage',
|
||||||
subject: 'Flow',
|
subject: 'Flow',
|
||||||
},
|
},
|
||||||
'DELETE /api/v1/folders/:folderId': {
|
'DELETE /api/v1/folders/:folderId': {
|
||||||
action: 'create',
|
action: 'manage',
|
||||||
subject: 'Flow',
|
subject: 'Flow',
|
||||||
},
|
},
|
||||||
'GET /api/v1/folders/': {
|
'GET /api/v1/folders/': {
|
||||||
@@ -154,7 +154,7 @@ const authorizationList = {
|
|||||||
subject: 'Flow',
|
subject: 'Flow',
|
||||||
},
|
},
|
||||||
'PATCH /api/v1/flows/:flowId/folder': {
|
'PATCH /api/v1/flows/:flowId/folder': {
|
||||||
action: 'update',
|
action: 'manage',
|
||||||
subject: 'Flow',
|
subject: 'Flow',
|
||||||
},
|
},
|
||||||
'GET /api/v1/flows/:flowId/folder': {
|
'GET /api/v1/flows/:flowId/folder': {
|
||||||
|
|||||||
@@ -17,56 +17,22 @@ const permissionCatalog = {
|
|||||||
conditions: [
|
conditions: [
|
||||||
{
|
{
|
||||||
key: 'isCreator',
|
key: 'isCreator',
|
||||||
label: 'Is creator'
|
label: 'Is creator',
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
actions: [
|
actions: [
|
||||||
{
|
{
|
||||||
label: 'Create',
|
label: 'Manage',
|
||||||
key: 'create',
|
key: 'manage',
|
||||||
subjects: [
|
subjects: [Connection.key, Flow.key],
|
||||||
Connection.key,
|
|
||||||
Flow.key,
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Read',
|
label: 'Read',
|
||||||
key: 'read',
|
key: 'read',
|
||||||
subjects: [
|
subjects: [Connection.key, Execution.key, Flow.key],
|
||||||
Connection.key,
|
|
||||||
Execution.key,
|
|
||||||
Flow.key,
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
|
||||||
label: 'Update',
|
|
||||||
key: 'update',
|
|
||||||
subjects: [
|
|
||||||
Connection.key,
|
|
||||||
Flow.key,
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Delete',
|
|
||||||
key: 'delete',
|
|
||||||
subjects: [
|
|
||||||
Connection.key,
|
|
||||||
Flow.key,
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Publish',
|
|
||||||
key: 'publish',
|
|
||||||
subjects: [
|
|
||||||
Flow.key,
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
],
|
||||||
subjects: [
|
subjects: [Connection, Flow, Execution],
|
||||||
Connection,
|
|
||||||
Flow,
|
|
||||||
Execution
|
|
||||||
]
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default permissionCatalog;
|
export default permissionCatalog;
|
||||||
|
|||||||
Reference in New Issue
Block a user