We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

Unable to fetch proper roles of table

parth2922
Tera Contributor
Hello Everyone, 
                          Currently, I am fetching table read roles with "sys_security_acl_role" and i pass the argument "operation" as read and "name" as table name
acl_url = f"{instance_url}/api/now/table/sys_security_acl_role"
params = {"sys_security_acl.operation": "read", "sys_security_acl.name": incident}
 
But in the response i got multiple roles as below:
ml_report_user
ml_admin
itil
sn_incident_read
 
So, here sn_incident_read is correct as the user with sn_incident_read has access to read the table but why i am getting ml_report_user, ml_admin, and itil where ml_report_user, ml_admin does not have read access to the table. 
 
Does anyone know how can i fetch only roles that have read access to the table only?
5 REPLIES 5

parth2922
Tera Contributor

Yes @Tai Vu I got your point. But I am writing a script in Python to fetch users who have read access to a specific table. I fetch the roles of users and compare the above roles. But when I set sys_security_acl.operation to read I got ml_report_user and ml_admin. which breaks my script as the user only has ml_report_user or ml_admin role and does not read the incident table. Do you have any other way to find this,