- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2024 01:57 AM
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.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2024 02:18 AM - edited 12-10-2024 02:21 AM
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;
}
Thanks,
Raj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2024 02:18 AM - edited 12-10-2024 02:21 AM
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;
}
Thanks,
Raj