- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2016 11:05 AM
I have written a very simple script in the View Rule, but it is not working for some reason. I am wanting to show the ess view for any user who is not an admin....
Here is my script:
(function overrideView(view, is_list) {
answer = null; // set the new view to answer
var isAdmin = g_user.hasRole('admin');
if (!isAdmin) { answer = "ess"; }
})(view, is_list);
Any advice?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2016 11:09 AM
Hi Josh,
g_user is a client side operation. The view rule is running on the server.
Try
var isAdmin = gs.hasRole('admin');

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2016 11:09 AM
Hi Josh,
g_user is a client side operation. The view rule is running on the server.
Try
var isAdmin = gs.hasRole('admin');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2016 11:12 AM
Thank you very much