[permissions V2] Add integration tests on relations and objectRecord permissions (#12450)
In this PR 1. adding tests on relations and nested relations to make sure that if any permission is missing, the query fails 2. adding tests on objectRecord permissions to make sure that permissions granted or restricted by objectPermissions take precedence on the role's allObjectRecords permissions
This commit is contained in:
@ -0,0 +1,31 @@
|
||||
export const updateWorkspaceMemberRole = async ({
|
||||
client,
|
||||
roleId,
|
||||
workspaceMemberId,
|
||||
}: {
|
||||
client: any;
|
||||
roleId: string;
|
||||
workspaceMemberId: string;
|
||||
}) => {
|
||||
const updateMemberRoleQuery = {
|
||||
query: `
|
||||
mutation UpdateWorkspaceMemberRole {
|
||||
updateWorkspaceMemberRole(
|
||||
workspaceMemberId: "${workspaceMemberId}"
|
||||
roleId: "${roleId}"
|
||||
) {
|
||||
id
|
||||
roles {
|
||||
id
|
||||
label
|
||||
}
|
||||
}
|
||||
}
|
||||
`,
|
||||
};
|
||||
|
||||
await client
|
||||
.post('/graphql')
|
||||
.set('Authorization', `Bearer ${ADMIN_ACCESS_TOKEN}`)
|
||||
.send(updateMemberRoleQuery);
|
||||
};
|
||||
Reference in New Issue
Block a user