ACL on mobile UI
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2017 02:48 AM
Hello,
I'm trying to restrict access to some records in mobile interface (e.g. on sysapproval.approver table for example).
I tried to create ACL based on scripts from the community but neither "isMobile" nor "GlideTransaction.get().getPageName != 'angular';" seem to work .
Is there any way to use this interface correctly or is it just open bar for all users ?
Thanks for your help !
- Labels:
-
Now Mobile

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2017 07:43 AM
Hi Damien - have a solution that has worked for me -
In your ACL put the following in the script field, which will log the page name to the system logs
gs.log(GlideTransaction.get().getPageName().toString())
And then you can build you ACL around that - for example, when loading the incident list in the Mobile UI, the getPageName returns "api/now/v1/ui/table_layout/incident" so the resulting ACL script is now:
answer = true;
if ( GlideTransaction.get().getPageName().toString() == "api/now/v1/ui/table_layout/incident") {
answer=false;
}
It may break in future versions, but there is no other fix (official or otherwise) that works.
Hope this is helpful Damien! Kudos to Paul U for the tip off.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2017 05:25 AM
Hi Adam and sorry for the late answer !
I finally succeeded in creating my ACL by using the isMobile attribute. The point is that we are no longer using the Dublin mobile UI and may be the following script didn't work in the previous version.
var mob = gs.isMobile();
if (mob != true){
answer = gs.hasRole('itil') ;