1
0
mirror of https://gitlab.com/bramw/baserow.git synced 2024-11-21 23:37:55 +00:00
bramw_baserow/enterprise/web-frontend/modules/baserow_enterprise/services/roleAssignments.js

34 lines
733 B
JavaScript

export default (client) => {
return {
assignRole(
subjectId,
subjectType,
workspaceId,
scopeId,
scopeType,
roleUid
) {
return client.post(`/role/${workspaceId}/`, {
subject_id: subjectId,
subject_type: subjectType,
scope_id: scopeId,
scope_type: scopeType,
role: roleUid,
})
},
assignRoleBatch(workspaceId, items) {
return client.post(`/role/${workspaceId}/batch/`, {
items,
})
},
getRoleAssignments(workspaceId, scopeId, scopeType) {
return client.get(`/role/${workspaceId}/`, {
params: {
scope_id: scopeId,
scope_type: scopeType,
},
})
},
}
}