6.0.26 - using [% Env{"UserIsGroup[support]")

Moderator: crythias

Post Reply
kruegerM
Znuny expert
Posts: 213
Joined: 02 Dec 2010, 16:53
Znuny Version: 6.0.29
Real Name: Marc
Company: National Jewish Health
Location: Denver, CO

6.0.26 - using [% Env{"UserIsGroup[support]")

Post by kruegerM »

We have two custom "button" links we added to our menu when you zoom a ticket -- available only two certain agents.
I've been able to control access using logic on logins, ie;
if ('[% Env("UserLogin") | html %]' eq 'makrueger') { .......
But with the way people change here, I thought using their OTRS group made more sense.

I've tried:
if ('[% Env("UserIsGroup[support]") %] = Yes') {
and
if ('[% Env("UserIsGroup[support]") %]') {
and
if ('[% Env("UserIsGroup[support]") %]' eq 'Yes') {
and
if ('[% Env("UserIsGroup[support]") | html %]' eq 'Yes') {

but nothing is working, even though I am part of the 'support' group.
Can someone see my error and point me in the right direction for using 'UserIsGroup' ??

Thanks!


M
zzz
Znuny superhero
Posts: 889
Joined: 15 Dec 2016, 15:13
Znuny Version: All
Real Name: Emin
Company: Efflux GmbH
Contact:

Re: 6.0.26 - using [% Env{"UserIsGroup[support]")

Post by zzz »

Hey,

There is no environment variable called 'UserIsGroup'.

You can limit the access within the system configuration; no need to change the template.

Description of ''Ticket::Frontend::MenuModule###430-Merge' for example:
[...] Additional access control to show or not show this link can be done by using Key "Group" and Content like "rw:group1;move_into:group2". [...]

Just do that with your own buttons.

Best regards
Emin
Professional OTRS, Znuny & OTOBO services: efflux.de | efflux.de/en/

Free and premium add-ons: German | English
kruegerM
Znuny expert
Posts: 213
Joined: 02 Dec 2010, 16:53
Znuny Version: 6.0.29
Real Name: Marc
Company: National Jewish Health
Location: Denver, CO

Re: 6.0.26 - using [% Env{"UserIsGroup[support]")

Post by kruegerM »

My apologies - confusion came from page 32 of the 6.0 Developer's Guide (pic attached also):

The current user name is: [% Env("UserFullname") %]
Some other common predefined variables are:
[% Env("Action") %] --> the current action
[% Env("Baselink") %] --> the baselink --> index.pl?SessionID=...
[% Env("CGIHandle") %] --> the current CGI handle e. g. index.pl
[% Env("SessionID") %] --> the current session id
[% Env("Time") %] --> the current time e. g. Thu Dec 27 16:00:55 2001
[% Env("UserFullname") %] --> e. g. Dirk Seiffert
[% Env("UserIsGroup[admin]") %] = Yes
[% Env("UserIsGroup[users]") %] = Yes --> user groups (useful for own links)
[% Env("UserLogin") %] --> e. g. mgg@x11.org


I will look at Sys Config as a possible solution also.
zzz
Znuny superhero
Posts: 889
Joined: 15 Dec 2016, 15:13
Znuny Version: All
Real Name: Emin
Company: Efflux GmbH
Contact:

Re: 6.0.26 - using [% Env{"UserIsGroup[support]")

Post by zzz »

Oh yes, you're right.
It's probably just a leftover from an older version, where logic was used more frequently in templates.

That changed and nowadays you either put your logic into the Perl module and render the block or you add your own configuration if supported.
Navigation elements and buttons are no problem, as mentioned above, to be added via an XML.

Best regards
Emin
Professional OTRS, Znuny & OTOBO services: efflux.de | efflux.de/en/

Free and premium add-ons: German | English
Post Reply