- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2018 10:05 AM
Greetings folks.
So, I've created specific Groups for the people about to access our new Asset Management application. I've created one of the two Views that I'm going to need. Now I'm trying to figure out how to restrict those group members to seeing the view I've created for them.
CHeers
A.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2018 01:32 PM
Yes. Do this
(function overrideView(view, is_list) {
if(gs.getUser().isMemberOf('<Your group name 1>') || gs.getUser().isMemberOf('<Your group name 2>')) {
answer = "Admin";
} else if(gs.getUser().isMemberOf('<Your group name 3>'){
answer = "Technicians";
} else {
answer = "default";
}
// set the new view to answer
})(view, is_list);
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2018 11:56 AM
Question for you Sanjiv.
I have three groups using two different views,
Is it possible for me to add an Or statement to the view rule like this?

Or is that even a thing?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2018 12:03 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2018 12:12 PM
No. Do like this
(function overrideView(view, is_list) {
if(gs.getUser().isMemberOf('<Your group name 1>') || gs.getUser().isMemberOf('<Your group name 2>')) {
answer = "Admin";
} else {
answer = "Technicians";
}
// set the new view to answer
})(view, is_list);
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2018 01:07 PM
Ok so the paired Pipe acts like an or statement?
Cool. So I guess the only thing else for me to figure out is the Technician view.
I realise that what I had filled into your script essentially sets the default view to the Technicians view that I had created. So the else statement should be:
else {
answer = "Default";
}
And then figure out how to set the technicians group view... is it possible to have a third IF term? or could I construct another If/Else after the first one?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2018 01:32 PM
Yes. Do this
(function overrideView(view, is_list) {
if(gs.getUser().isMemberOf('<Your group name 1>') || gs.getUser().isMemberOf('<Your group name 2>')) {
answer = "Admin";
} else if(gs.getUser().isMemberOf('<Your group name 3>'){
answer = "Technicians";
} else {
answer = "default";
}
// set the new view to answer
})(view, is_list);
Please mark this response as correct or helpful if it assisted you with your question.
