ACL

abhisek
Tera Contributor

There is a table 'abc' that supports the catalog item 'xyz'.

I have created the below ACL on the table 'abc':

 

if (gs.getUserID() == '1234' || !gs.getSession().isInteractive() || gs.getUser().isMemberOf("gefg545") || gs.getUser().isMemberOf("3234gfg")) {
answer = true;
} else {
answer = false;
}

 

The above script Manually working when impersonating and checking but not working when the records are entered through API.

 

Can anyone please help me out.

 

Thanks&Regards,

Abhisek Chattaraj.

1 ACCEPTED SOLUTION

raj chavan
Tera Guru

Hi  
issue maybe occurs because the `gs.getSession().isInteractive()` check returns `false` for API calls, which is expected behavior however if api failing it is possible that session context for api is not handled properly

 Ensure the script explicitly checks for non-interactive sessions and grants access if it meets the conditions

 

 

   if (!gs.getSession().isInteractive() || gs.getUserID() == '1234' || 
       gs.getUser().isMemberOf("gefg545") || gs.getUser().isMemberOf("3234gfg")) {
       answer = true;
   } else {
       answer = false;
   }

 

Confirm the user or integration account used for the API call has the correct roles and group memberships
 Ensure the API user is granted the required roles to access and modify records in the `abc` table.
 
Kindly mark it correct and helpful if it is applicable.

Thanks,

Raj

View solution in original post

1 REPLY 1

raj chavan
Tera Guru

Hi  
issue maybe occurs because the `gs.getSession().isInteractive()` check returns `false` for API calls, which is expected behavior however if api failing it is possible that session context for api is not handled properly

 Ensure the script explicitly checks for non-interactive sessions and grants access if it meets the conditions

 

 

   if (!gs.getSession().isInteractive() || gs.getUserID() == '1234' || 
       gs.getUser().isMemberOf("gefg545") || gs.getUser().isMemberOf("3234gfg")) {
       answer = true;
   } else {
       answer = false;
   }

 

Confirm the user or integration account used for the API call has the correct roles and group memberships
 Ensure the API user is granted the required roles to access and modify records in the `abc` table.
 
Kindly mark it correct and helpful if it is applicable.

Thanks,

Raj