Custom Quick Actions
Re: Custom Quick Actions
I will be testing this as soon as developers finish the task. I am not sure when they are going to get to it, since this is not a priority at the moment. In any case, we will post the results.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Custom Quick Actions
I just tested and this worked:
this hides all custom actions on services from non admins. Verified and tested 
Do the same to the hosts file and it'll work there.
Code: Select all
786 if(is_admin() == true) {
787 // additional actions...
788 $cbdata=array(
789 "hostname" => $hostname,
790 "servicename" => $servicename,
791 "service_id" => $service_id,
792 "servicestatus_xml" => $xml,
793 "actions" => array(),
794 );
795 do_callbacks(CALLBACK_SERVICE_DETAIL_ACTION_LINK,$cbdata);
796 $customactions=grab_array_var($cbdata,"actions",array());
797 foreach($customactions as $ca){
798 $output.=$ca;
799 }
800 //$output.=serialize($customactions);
801
802 }
803 }
Do the same to the hosts file and it'll work there.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
-
sreinhardt
- -fno-stack-protector
- Posts: 4366
- Joined: Mon Nov 19, 2012 12:10 pm
Re: Custom Quick Actions
Sweet, thanks for the test!
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Re: Custom Quick Actions
Hello,
Just wanted to inquire to the state of this feature request to enable us to set view permissions per task. We have some actions that need to be visible by normal users, and other that may only be seen by admins.
Tx
Just wanted to inquire to the state of this feature request to enable us to set view permissions per task. We have some actions that need to be visible by normal users, and other that may only be seen by admins.
Tx
Nagios XI 5.8.1
https://outsideit.net
https://outsideit.net
Re: Custom Quick Actions
He did leave this comment on the feature request, will that not work for you?
I'm going to see about getting this added but just so you guys are aware, you can add the following into the Code box, it will only show for Admins
Code: Select all
if(is_admin()){$showlink=true;} else{$showlink=false;}
Re: Custom Quick Actions
Sean,
Sorry I thought I read in the thread:
EDIT: I tried:
But the link to the Reactor chain keeps showing for my test normal user. Am I missing something?
EDIT: Never mind, it was actually just
My PHP knowledge is very low. Sorry for that. You can close this thread. This solution is perfect for now. 
Grtz
Sorry I thought I read in the thread:
So I was thinking this only works for all actions or none. I will try your suggestion.this hides all custom actions on services from non admins
EDIT: I tried:
Code: Select all
/*if((%objecttype%=='host' && '%hoststateid%'!='0') || (%objecttype%=='service' && '%servicestateid%'!='0')){$img='/nagiosxi/images/schedulecheck.png';$showlink=true;} else{$showlink=false;}if(is_admin()){$showlink=true;} else{$showlink=false;}*/Code: Select all
/*if((%objecttype%=='host' && '%hoststateid%'!='0') || (%objecttype%=='service' && '%servicestateid%'!='0')){$img='/nagiosxi/images/schedulecheck.png';$showlink=true;} else{$showlink=false;};if(is_admin()){$showlink=true;} else{$showlink=false;}*/Code: Select all
/*if(is_admin()){$showlink=true;} else{$showlink=false;}*/EDIT: Never mind, it was actually just
Code: Select all
if(is_admin()){$showlink=true;} else{$showlink=false;}Grtz
Nagios XI 5.8.1
https://outsideit.net
https://outsideit.net