@@ -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