mirror of
https://gitlab.com/bramw/baserow.git
synced 2024-11-21 23:37:55 +00:00
34 lines
733 B
JavaScript
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,
|
|
},
|
|
})
|
|
},
|
|
}
|
|
}
|