968d2f2520
* wip * wip * feat(authz): wip policy shape * wip * fix(authz): canReadProject with latest pattern * wip * feat(shared): simplify authz checks and policies * feat(shared): port role weights into shared * test(shared): some more tests for authz * test(shared): more query project tests * typo! * feat(shared): ff loading refinements * feat(shared): example authorization policy integration * authz loaders init * chore(authz): naming etc * wip * fix(authz): authz error objects Co-authored-by: Kristaps Fabians Geikins <fabis94@users.noreply.github.com> Co-authored-by: Gergő Jedlicska <gjedlicska@users.noreply.github.com> * fix(authz): use correct role weights * chore(authz): use codes from errors in tests * chore(authz): wow * chore(authz): fix more tests, add more tests * chore(authz): fix some tests, add some tests (again) * fix(authz): fix tests again * fix(server): you need to await !!!! otherwise it crashes the server. --------- Co-authored-by: Charles Driesler <chuck@speckle.systems> Co-authored-by: Kristaps Fabians Geikins <fabis94@users.noreply.github.com> Co-authored-by: Gergő Jedlicska <gjedlicska@users.noreply.github.com>
33 lines
842 B
TypeScript
33 lines
842 B
TypeScript
import { UserWorkspaceRole } from '@/modules/shared/domain/rolesAndScopes/types'
|
|
import { Roles, RoleInfo } from '@speckle/shared'
|
|
import { pick } from 'lodash'
|
|
|
|
const aclTableName = 'workspace_acl'
|
|
const resourceTarget = 'workspaces'
|
|
|
|
const keysToPick = ['weight', 'description'] as const
|
|
|
|
export const workspaceRoles: UserWorkspaceRole[] = [
|
|
{
|
|
name: Roles.Workspace.Admin,
|
|
...pick(RoleInfo.Workspace[Roles.Workspace.Admin], keysToPick),
|
|
public: true,
|
|
resourceTarget,
|
|
aclTableName
|
|
},
|
|
{
|
|
name: Roles.Workspace.Member,
|
|
...pick(RoleInfo.Workspace[Roles.Workspace.Member], keysToPick),
|
|
public: true,
|
|
resourceTarget,
|
|
aclTableName
|
|
},
|
|
{
|
|
name: Roles.Workspace.Guest,
|
|
...pick(RoleInfo.Workspace[Roles.Workspace.Guest], keysToPick),
|
|
public: true,
|
|
resourceTarget,
|
|
aclTableName
|
|
}
|
|
]
|