1
0
Fork 0
mirror of https://gitlab.com/bramw/baserow.git synced 2025-05-02 16:10:02 +00:00
bramw_baserow/web-frontend/modules/core/services/roles.js

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

31 lines
1.1 KiB
JavaScript
Raw Normal View History

export default (client, $hasFeature, $registry) => {
2022-10-13 21:18:34 +02:00
return {
// TODO implement once endpoint exists
get(workspace) {
2022-10-13 21:18:34 +02:00
return {
data: Object.values($registry.getAll('roles')).map((role) =>
role.getUid() === 'NO_ROLE_LOW_PRIORITY'
? {
uid: role.getUid(),
description: role.getDescription(),
showIsBillable: role.showIsBillable(workspace.id),
isBillable: role.getIsBillable(workspace.id),
isVisible: role.isVisible(workspace.id),
isDeactivated: role.isDeactivated(workspace.id),
allowed_scope_types: ['workspace'],
allowed_subject_types: ['auth.User'],
}
: {
uid: role.getUid(),
description: role.getDescription(),
showIsBillable: role.showIsBillable(workspace.id),
isBillable: role.getIsBillable(workspace.id),
isVisible: role.isVisible(workspace.id),
isDeactivated: role.isDeactivated(workspace.id),
}
),
2022-10-13 21:18:34 +02:00
}
},
}
}