How to Find a specified user has access permission(read/write) to particular table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-28-2014 10:37 AM
How to check a specified user has access permission(read/write) to particular table.
I am using below code.
var gr = new GlideRecord("incident");
if (!gr.canRead()) {
gs.log("## Insufficient rights to query incident records: ");
}
Above Script doesn't work since canRead() always return "true", even the User doesn't have any Role.
Any thoughts appreciated.
Thanks for your time.
- Labels:
-
Integrations
-
User Interface (UI)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-05-2014 05:51 AM
You can use GlideRecordSecure if you need to do any kind of scripting. Otherwise I would just open a new browser window (with a new session), turn on security debugging, and impersonate the user in question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-06-2014 10:01 AM
Thank you very much for your suggestion.
I have tried below code.
var att = new GlideRecordSecure('incident');
att.get('8cbc7b68a4cb55000a476310c119bb73');
var sm = Packages.com.glide.sys.security.GlideSecurityManager.get();
var checkMe = 'record/incident/read';
var canRead= sm.hasRightsTo(checkMe, att);
gs.log('##My log: ' + canRead);
But this is return always true even the user doesn't have any role / access to incident table. And also i am using Berlin Version.GlideRecordSecure is available starting with the calgary version.
Any thoughts?
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-06-2014 10:03 AM
Open a new browser window (with a new session), turn on security debugging, and impersonate the user in question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-06-2014 10:01 AM
Thank you very much for your suggestion.
I have tried below code.
var att = new GlideRecordSecure('incident');
att.get('8cbc7b68a4cb55000a476310c119bb73');
var sm = Packages.com.glide.sys.security.GlideSecurityManager.get();
var checkMe = 'record/incident/read';
var canRead= sm.hasRightsTo(checkMe, att);
gs.log('##My log: ' + canRead);
But this is return always true even the user doesn't have any role / access to incident table. And also i am using Berlin Version. GlideRecordSecure is available starting with the calgary version.
Any thoughts?
Thanks,