feat(editor): Add routing middleware, permission checks, RBAC store, RBAC component (#7702)
Github issue / Community forum post (link here to close automatically): --------- Co-authored-by: Csaba Tuncsik <csaba@n8n.io>
This commit is contained in:
@@ -44,4 +44,14 @@ describe('parsePermissionsTable()', () => {
|
||||
|
||||
expect(permissions.canRead).toBe(true);
|
||||
});
|
||||
|
||||
it('should pass permission to test functions', () => {
|
||||
const permissions = parsePermissionsTable(user, [
|
||||
{ name: 'canRead', test: (p) => !!p.isInstanceOwner },
|
||||
{ name: 'canUpdate', test: (p) => !!p.canRead },
|
||||
]);
|
||||
|
||||
expect(permissions.canRead).toBe(true);
|
||||
expect(permissions.canUpdate).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user