how to make a table read only for all users

nagendra1891
Kilo Contributor

Hey guys ,

i have a table which should be accessible for all users.   ( by default accessible only for system admin )

Screen Shot 2016-08-01 at 1.21.03 PM.png

unchecked create access control .

does this mean this record can be called by all the user?

basically there is a ui action script which makes call to this record   ( or a table) to fetch data

this works only for the system admin not when i impersonate a normal user.

i want this table to be accessible to all!

Script looks like this

          var FolderID = new GlideRecord('u_#####');

          FolderID.addQuery('u_######',number);

          FolderID.query();

// When logged in as system admin can access records form this table.

need to make this table accessible to all

any help is appreciated

Regards

NB

12 REPLIES 12

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Nagendra,



This should work. GlideRecord will not not enforce for ACL's where as GlideRecordSecure does.


unfortunately the query returns null when i impersonate user !


but works as expected with system admin.




Chuck Tomasi
Tera Patron

If it is returning null, check that query closely. What is 'number'?



To get a count of the records retrieved, try placing this right after your query();



gs.log(FolderID.getRowCount() + ' records read');



If it comes back with 0, comment out your addQuery() line and try again. If it gets a number, you know your addQuery is filtering out everything. It it still comes back with 0, check the logs and make sure you have a valid table (you'll see all kinds of nasty errors.)


I got this error !



Error with UI action TypeError: FolderID.getRowCount is not a function



i am able to access the records when i am logged in as a system admin


the problem is when i log in as a user !



is this a access issue ?



regards


NB