How to restrict the records based on Users?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2023 08:01 AM
Hi,
Greetings of the day!
We want to restrict our table records based on users.
Example: User 'XYZ' should see only the records which contain function as 'ABC'.
Solution which already applied:
We have created query BR and adding the GPID from the system property. However this should not be scalable because every time when user needs to be added we need to open the BR and property to add those users.
Can you please help with other scalable solution to achieve this?
Thanks in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2023 08:26 AM
Hi Sovan,
I suggest you post the BR logic and the table(s) it is defined for, and specify what a "GPID" is. folks here can then assist.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2023 08:34 AM
Below is the BR logic:
1) Created before query BR for table "GBS Role" table (custom)
2) Logic is :
if (gs.hasRole("admin")) {
//These users will have access to all roles irrespective of capabilities
} else {
var query_str = '';
//get the users GPID from the property pep.infra.usersGPID
var users = gs.getProperty("x_inpe_gbs_inf.pep.infra.usersGPID").split(",");
//Rules for Functions
if (gs.getUserName() == users[0] || gs.getUserName() == users[1]) {
query_str = query_str + 'rolefunction=12e47c7a9778e5903bf132471153af3b';
}
current.addQuery(query_str);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2023 08:50 AM
I would replace the business rule with ACL, that would be the right place for restricting access to records.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2023 08:58 AM
How we can add the users if we use ACL? We need to create roles for that right.