ACL match properties with variables

Moderator: crythias

Post Reply
artjoms15
Znuny advanced
Posts: 121
Joined: 30 Aug 2011, 10:48
Znuny Version: 3.3.8 && 4.0.9
Real Name: Artjoms Petrovs
Location: Latvia

ACL match properties with variables

Post by artjoms15 »

Hello!
Is it possible to compare ACL properties with system variables? For example to compare if the current user is the creator of a ticket. I mean somehow compare
CustomerUser => { UserCustomerID => [Ticket => CustomerUserID] I already created test variables like $user='xxx' and if I use that variable it works okey, so maybe anyone can tell me how to acquire current user ID or suggest a better idea then I imagined

Thank You in advance!
Ar cieņu / Kind regards,
----------------------------------------
Artjoms Petrovs
Sistēmu analītiķis/Programmētājs /
Systems Analyst/Programmer
artjoms15
Znuny advanced
Posts: 121
Joined: 30 Aug 2011, 10:48
Znuny Version: 3.3.8 && 4.0.9
Real Name: Artjoms Petrovs
Location: Latvia

Re: ACL match properties with variables

Post by artjoms15 »

I think I solved this problem. It appeared only because of my programmer iliteracy
Solution:

Code: Select all

$Self->{TicketAcl}->{'TESTUSERSSSSSSS'} = {
  # match properties
	Properties => {
        Frontend => {
           Action => ['CustomerTicketMessage'],
        },
		User => {
		
		 UserCustomerID => [$Env{"UserLogin"}],

		},
   },
    Possible => {
        Ticket => {
            Type => ['Incident'],
         },
    },
}; 
Ar cieņu / Kind regards,
----------------------------------------
Artjoms Petrovs
Sistēmu analītiķis/Programmētājs /
Systems Analyst/Programmer
stek
Znuny newbie
Posts: 11
Joined: 26 Aug 2019, 12:14
Znuny Version: 6.0.18

Re: ACL match properties with variables

Post by stek »

Hi,
I tried to create an ACL like the one above but it doesn't work.

I ask you if it is possible to pass and how to create an ACL that shows certain values of a field based on the customer user who logged in and is creating the ticket (I would like to pass in the acl the variable Env {"UserLogin"} from which I retrieve the 'logged in user).

Thanks in advance for availability
root
Administrator
Posts: 3964
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: ACL match properties with variables

Post by root »

Hi,

You have to write your own ACL module, this is an example: https://github.com/OTRS/otrs/blob/rel-6 ... dChilds.pm

- Roy
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 ?
stek
Znuny newbie
Posts: 11
Joined: 26 Aug 2019, 12:14
Znuny Version: 6.0.18

[SOLVED]Re: ACL match properties with variables

Post by stek »

thanks for the support, I opted for a different path
Post Reply