1
0
Fork 0
mirror of https://gitlab.com/bramw/baserow.git synced 2025-05-18 06:41:02 +00:00
bramw_baserow/enterprise/web-frontend/modules/baserow_enterprise/services/roleAssignments.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

34 lines
733 B
JavaScript
Raw Permalink Normal View History

2022-10-13 21:18:34 +02:00
export default (client) => {
return {
assignRole(
subjectId,
subjectType,
workspaceId,
scopeId,
scopeType,
roleUid
) {
return client.post(`/role/${workspaceId}/`, {
2022-10-13 21:18:34 +02:00
subject_id: subjectId,
subject_type: subjectType,
scope_id: scopeId,
scope_type: scopeType,
role: roleUid,
})
},
assignRoleBatch(workspaceId, items) {
return client.post(`/role/${workspaceId}/batch/`, {
2022-11-25 08:23:38 +00:00
items,
})
},
getRoleAssignments(workspaceId, scopeId, scopeType) {
return client.get(`/role/${workspaceId}/`, {
2022-11-25 08:23:38 +00:00
params: {
scope_id: scopeId,
scope_type: scopeType,
},
})
},
2022-10-13 21:18:34 +02:00
}
}