Skip to content

Commit d0dacd4

Browse files
Copilotmserico
andcommitted
Fix linting issues
Co-authored-by: mserico <[email protected]>
1 parent 1d32189 commit d0dacd4

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/enforcer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ export class Enforcer extends ManagementEnforcer {
313313
q.push(r);
314314
}
315315
});
316-
316+
317317
// Also get roles with wildcard domain '*' if domain is provided and not already '*'
318318
if (domain && domain.length > 0 && domain[0] !== '*') {
319319
const wildcardDomain = [...domain];
@@ -354,7 +354,7 @@ export class Enforcer extends ManagementEnforcer {
354354
// Get policies matching the specific domain
355355
const p = await this.getFilteredPolicy(0, n, ...domain);
356356
res.push(...p);
357-
357+
358358
// Also get policies with wildcard domain '*' if the domain is not already '*'
359359
if (domain[0] !== '*') {
360360
const wildcardDomain = [...domain];

test/rbacRoleHierarchyDomains.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ describe('Test Role Hierarchy with Domains and Wildcards', () => {
99

1010
// Test michael in tenant1 - should get permissions from abstract_role1 with domain *
1111
const michaelPerms = await e.getImplicitPermissionsForUser('michael', 'tenant1');
12-
12+
1313
// Michael should have:
1414
// - abstract_role1 permissions (devis read/create) with domain *
1515
expect(michaelPerms).toContainEqual(['abstract_role1', '*', 'devis', 'read']);
1616
expect(michaelPerms).toContainEqual(['abstract_role1', '*', 'devis', 'create']);
1717

1818
// Test thomas in tenant1 - should get permissions from abstract_role2 with domain *
1919
const thomasPerms = await e.getImplicitPermissionsForUser('thomas', 'tenant1');
20-
20+
2121
// Thomas should have:
2222
// - abstract_role2 permissions (devis read, organization read/write) with domain *
2323
expect(thomasPerms).toContainEqual(['abstract_role2', '*', 'devis', 'read']);
@@ -26,7 +26,7 @@ describe('Test Role Hierarchy with Domains and Wildcards', () => {
2626

2727
// Test theo with super_user - should get permissions from abstract_role2 with domain *
2828
const theoPerms = await e.getImplicitPermissionsForUser('theo', 'tenant1');
29-
29+
3030
// Theo should have:
3131
// - abstract_role2 permissions (devis read, organization read/write) with domain *
3232
expect(theoPerms).toContainEqual(['abstract_role2', '*', 'devis', 'read']);
@@ -43,17 +43,17 @@ describe('Test Role Hierarchy with Domains and Wildcards', () => {
4343
// Michael in tenant1 should be able to read devis
4444
expect(await e.enforce('michael', 'tenant1', 'devis', 'read')).toBe(true);
4545
expect(await e.enforce('michael', 'tenant1', 'devis', 'create')).toBe(true);
46-
46+
4747
// Michael in tenant2 should NOT have access (not assigned to tenant2)
4848
expect(await e.enforce('michael', 'tenant2', 'devis', 'read')).toBe(false);
49-
49+
5050
// Antoine in tenant2 should be able to read devis
5151
expect(await e.enforce('antoine', 'tenant2', 'devis', 'read')).toBe(true);
52-
52+
5353
// Thomas in tenant1 should have organization permissions
5454
expect(await e.enforce('thomas', 'tenant1', 'organization', 'read')).toBe(true);
5555
expect(await e.enforce('thomas', 'tenant1', 'organization', 'write')).toBe(true);
56-
56+
5757
// Theo with super_user should have access to any tenant
5858
expect(await e.enforce('theo', 'tenant1', 'organization', 'read')).toBe(true);
5959
expect(await e.enforce('theo', 'tenant2', 'organization', 'read')).toBe(true);

0 commit comments

Comments
 (0)