@@ -389,6 +389,33 @@ describe('DA auth', () => {
389389 assert ( aclCtx . actionSet . has ( 'read' ) ) ;
390390 assert ( ! aclCtx . actionSet . has ( 'write' ) ) ;
391391 } ) ;
392+
393+ it ( 'test DA_OPS_IMS_ORG permissions' , async ( ) => {
394+ const opsOrg = 'MyOpsOrg' ;
395+ const envOps = {
396+ ...env2 ,
397+ DA_OPS_IMS_ORG : opsOrg ,
398+ } ;
399+
400+ // User in the OPS ORG
401+ const users = [ { orgs : [ { orgIdent : opsOrg } ] } ] ;
402+ const aclCtx = await getAclCtx ( envOps , 'test' , users , '/' , 'config' ) ;
403+
404+ // Should have write permission on CONFIG because of DA_OPS_IMS_ORG injection
405+ assert ( hasPermission ( {
406+ users, org : 'test' , aclCtx, key : '' ,
407+ } , 'CONFIG' , 'write' , true ) ) ;
408+
409+ // Should have write permission on / because of DA_OPS_IMS_ORG injection (path: '/ + **')
410+ assert ( hasPermission ( {
411+ users, org : 'test' , aclCtx, key : '' ,
412+ } , '/' , 'write' ) ) ;
413+
414+ // Should have write permission on path because of DA_OPS_IMS_ORG injection (path: '/ + **')
415+ assert ( hasPermission ( {
416+ users, org : 'test' , aclCtx, key : '' ,
417+ } , '/some/deep/path' , 'write' ) ) ;
418+ } ) ;
392419 } ) ;
393420
394421 describe ( 'persmissions single sheet' , ( ) => {
0 commit comments