How can I make the e-mail icon in toolbar visible only to a certain group in OTRS. If I add the group restriction under Frontend::Module###AgentTicketEmail
in Ticket -> Frontend::Agent::ModuleRegistration, the icon is still visible but a user not in group gets an error. I also tried adding group parameter to Frontend::ToolBarModule###5-Ticket::AgentTicketEmail under Ticket -> Frontend::Agent::ToolBarModule, but it doesn't work. How can I hide the e-mail ticket icon for specific groups?
Restrict visibility of E-mail icon for certain groups
Moderator: crythias
Restrict visibility of E-mail icon for certain groups
OTRS 3.3.x (private/testing) on Windows Server 2008 with MSSQL database.
OTRS 3.3.x (private/testing) on CentOS with MySQL database and apache
OTRS 3.3.x (private/testing) on CentOS with MySQL database and apache
-
- Administrator
- Posts: 4011
- Joined: 18 Dec 2007, 12:23
- Znuny Version: Znuny and Znuny LTS
- Real Name: Roy Kaldung
- Company: Znuny
- Contact:
Re: Restrict visibility of E-mail icon for certain groups
That's excatly the right way. Did you double checked your settings?
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO
Use a test system - always.
Do you need professional services? Check out https://www.znuny.com/
Do you want to contribute or want to know where it goes ?
Use a test system - always.
Do you need professional services? Check out https://www.znuny.com/
Do you want to contribute or want to know where it goes ?
Re: Restrict visibility of E-mail icon for certain groups
Yes I did double check my settings
I don't want to block the email ticket functionality alltogether for the group, just the icon. But even when I add group restriction under Frontend::Module###AgentTicketEmail in Ticket -> Frontend::Agent::ModuleRegistration, the icon is still visible. I also double-checked the group name
I added 'Group' parameter to Frontend::ToolBarModule###5-Ticket::AgentTicketEmail under Ticket -> Frontend::Agent::ToolBarModule. It still doesn't work.I don't want to block the email ticket functionality alltogether for the group, just the icon. But even when I add group restriction under Frontend::Module###AgentTicketEmail in Ticket -> Frontend::Agent::ModuleRegistration, the icon is still visible. I also double-checked the group name
You do not have the required permissions to view the files attached to this post.
OTRS 3.3.x (private/testing) on Windows Server 2008 with MSSQL database.
OTRS 3.3.x (private/testing) on CentOS with MySQL database and apache
OTRS 3.3.x (private/testing) on CentOS with MySQL database and apache
Re: Restrict visibility of E-mail icon for certain groups
In fact, the Permission is not being verified for the ToolBar Modules.
See this older post: viewtopic.php?t=18370
And this bug record: http://bugs.otrs.org/show_bug.cgi?id=8971
I solved this by adding the code bellow on the file /Kernel/Output/HTML/Layout.pm (remember to copy to the Custom folder). I wish someone could modularize that and commit to the repository.
See this older post: viewtopic.php?t=18370
And this bug record: http://bugs.otrs.org/show_bug.cgi?id=8971
I solved this by adding the code bellow on the file /Kernel/Output/HTML/Layout.pm (remember to copy to the Custom folder). I wish someone could modularize that and commit to the repository.
Code: Select all
# run tool bar item modules
if ( $Self->{UserID} && $Self->{UserType} eq 'User' ) {
my $ToolBarModule = $Self->{ConfigObject}->Get('Frontend::ToolBarModule');
if ( $Param{ShowToolbarItems} && ref $ToolBarModule eq 'HASH' ) {
$Self->Block(
Name => 'ToolBar',
Data => \%Param,
);
my %Modules;
my %Jobs = %{$ToolBarModule};
MODULE:
for my $Job ( sort keys %Jobs ) {
#-------------- Check Permissions ------------------
# group check (Copied from TicketMenuGeneric)
if ( $Jobs{$Job}->{Group} ) {
my @Items = split /;/, $Jobs{$Job}->{Group};
my $AccessOk;
ITEM:
for my $Item (@Items) {
my ( $Permission, $Name ) = split /:/, $Item;
if ( !$Permission || !$Name ) {
$Self->{LogObject}->Log(
Priority => 'error',
Message => "Invalid config for Key Group: '$Item'! "
. "Need something like '\$Permission:\$Group;'",
);
}
my @Groups = $Self->{GroupObject}->GroupMemberList(
UserID => $Self->{UserID},
Type => $Permission,
Result => 'Name',
);
next ITEM if !@Groups;
GROUP:
for my $Group (@Groups) {
if ( $Group eq $Name ) {
$AccessOk = 1;
last GROUP;
}
}
}
next MODULE if !$AccessOk;
}
#-------------- End Check Permissions ------------------
# load and run module
next MODULE if !$Self->{MainObject}->Require( $Jobs{$Job}->{Module} );
...
Re: Restrict visibility of E-mail icon for certain groups
thanks Wagner for the hint
OTRS 3.3.x (private/testing) on Windows Server 2008 with MSSQL database.
OTRS 3.3.x (private/testing) on CentOS with MySQL database and apache
OTRS 3.3.x (private/testing) on CentOS with MySQL database and apache