[SOLVED] How can I use access control lists(ACLs) on dynamic fields?

Moderator: crythias

Locked
smuwanga
Znuny newbie
Posts: 27
Joined: 31 Dec 2014, 10:57
Znuny Version: 5.0.22
Real Name: Simon Peter Muwanga
Company: UgandaSoft
Contact:

[SOLVED] How can I use access control lists(ACLs) on dynamic fields?

Post by smuwanga »

Hello guys,

I have two dynamic fields, continent and country. On selecting a continent, its respective countries should show. However, the list of countries in my drop-down remains unchanged. What could I be doing wrong?

Here are my ACLs from Config.pm.

Code: Select all

#------------------ACLs----------------------------#
$Self->{TicketAcl}->{'100-continent-ACL'} = {
    # match properties
    Properties => {
        # current ticket match properties
        Ticket => {
            DynamicField_continent => ['Africa'],
        }
    },
    # return possible options (white list)
    Possible => {
        # possible ticket options (white list)
        Ticket => {
           DynamicField_country => ['Kenya','Uganda','South Africa'],
        },
    },
};
$Self->{TicketAcl}->{'101-continent-north-america-ACL'} = {
    # match properties
    Properties => {
        # current ticket match properties
        Ticket => {
            DynamicField_continent => ['North America'],
        }
    },
    # return possible options (white list)
    Possible => {
        # possible ticket options (white list)
        Ticket => {
           DynamicField_country => ['Canada','United States of America'],
        },
    },
};

$Self->{TicketAcl}->{'102-continent-Europe-ACL'} = {
    # match properties
    Properties => {
        # current ticket match properties
        Ticket => {
            DynamicField_continent => ['Europe'],
        }
    },
    # return possible options (white list)
    Possible => {
        # possible ticket options (white list)
        Ticket => {
           DynamicField_country => ['France'],
        },
    },
};
#------------end ACLs here-------------------------#
Thanking you,
Simon.
Last edited by smuwanga on 02 Jun 2015, 10:34, edited 1 time in total.
RStraub
Znuny guru
Posts: 2210
Joined: 13 Mar 2014, 09:16
Znuny Version: 6.0.14
Real Name: Rolf Straub

Re: How can I use access control lists(ACLs) on dynamic fields?

Post by RStraub »

This works in OTRS 4.x

You are still using 3.1 ?
Currently using: OTRS 6.0.14 -- MariaDB -- Ubuntu 16 LTS
smuwanga
Znuny newbie
Posts: 27
Joined: 31 Dec 2014, 10:57
Znuny Version: 5.0.22
Real Name: Simon Peter Muwanga
Company: UgandaSoft
Contact:

Re: How can I use access control lists(ACLs) on dynamic fields?

Post by smuwanga »

Thanks Rstraub.

Am still using 3.1.x . Am going to upgrade to test it out.
smuwanga
Znuny newbie
Posts: 27
Joined: 31 Dec 2014, 10:57
Znuny Version: 5.0.22
Real Name: Simon Peter Muwanga
Company: UgandaSoft
Contact:

Re: How can I use access control lists(ACLs) on dynamic fields?

Post by smuwanga »

Many thanks.
I have installed 4.0.8. It works fine.

Here are the ACLs.

Code: Select all

$Self->{TicketAcl}->{'100-continent-ACL'} = {
    # match properties
    Properties => {
        # current ticket match properties
       Frontend => {
            Action => ['AgentTicketEmail'],
        },
       DynamicField => {
            DynamicField_continent  => ['africa'],
            
        },
    },
    # return possible options (white list)
    Possible => {
        # possible ticket options (white list)
        Ticket => {
           DynamicField_country => ['kenya','uganda'],
        },
    },
};
$Self->{TicketAcl}->{'101-continent-ACL'} = {
    # match properties
    Properties => {
        # current ticket match properties
       Frontend => {
            Action => ['AgentTicketEmail'],
        },
       DynamicField => {
            DynamicField_continent  => ['north_america'],
            
        },
    },
    # return possible options (white list)
    Possible => {
        # possible ticket options (white list)
        Ticket => {
           DynamicField_country => ['canada','united_states_of_america'],
        },
    },
};
Notes:
-Use keys in the [] instead of values.
-don't use the root@localhost account
Smiith
Znuny newbie
Posts: 19
Joined: 22 Jul 2015, 10:49
Znuny Version: OTRS 4
Real Name: Muhammad Hassanine Haddad
Company: CIMEF

Re: [SOLVED] How can I use access control lists(ACLs) on dynamic fields?

Post by Smiith »

Hello !

Can you help me please, i'm newbie.
After editing the file Config.pm, i will find the fields automatically added in the ticket plateform ? or i must add dynamic fields ?

Thanks
smuwanga
Znuny newbie
Posts: 27
Joined: 31 Dec 2014, 10:57
Znuny Version: 5.0.22
Real Name: Simon Peter Muwanga
Company: UgandaSoft
Contact:

Re: [SOLVED] How can I use access control lists(ACLs) on dynamic fields?

Post by smuwanga »

Hello,

You will have to add the fields onto the AgentTicketEmail through SysConfig.
The topic Showing a Dynamic Field on a Screen at https://otrs.github.io/doc/manual/admin ... figuration shows how to display the fields on the screen. Thereafter, you can test how your ACL works. Let me know how it goes.
Smiith
Znuny newbie
Posts: 19
Joined: 22 Jul 2015, 10:49
Znuny Version: OTRS 4
Real Name: Muhammad Hassanine Haddad
Company: CIMEF

Re: [SOLVED] How can I use access control lists(ACLs) on dynamic fields?

Post by Smiith »

smuwanga wrote:Hello,

You will have to add the fields onto the AgentTicketEmail through SysConfig.
The topic Showing a Dynamic Field on a Screen at https://otrs.github.io/doc/manual/admin ... figuration shows how to display the fields on the screen. Thereafter, you can test how your ACL works. Let me know how it goes.
So you mean that first i must edit the Config.pm then add the fields in AgentTicketEmail through Sysconfig ?
What is the Key of the field in this example ? is it "DynamicField_continent" and "DynamicField_country" the Keys ?
I don't add them in the Dynamic Fields in Admin Menu ? i don't touch the Dynamic Fields in Admin Menu at all ?
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: [SOLVED] How can I use access control lists(ACLs) on dynamic fields?

Post by jojo »

ACLs need to be done in ACL Editor.
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
Smiith
Znuny newbie
Posts: 19
Joined: 22 Jul 2015, 10:49
Znuny Version: OTRS 4
Real Name: Muhammad Hassanine Haddad
Company: CIMEF

Re: [SOLVED] How can I use access control lists(ACLs) on dynamic fields?

Post by Smiith »

jojo wrote:ACLs need to be done in ACL Editor.
Can you tell me what to do exactly please ? i'm newbie
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: [SOLVED] How can I use access control lists(ACLs) on dynamic fields?

Post by jojo »

Read the admin manual, check examples in ACL Editor in Admin Tab.

If you need commercial support, contact sales@otrs.com
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
Smiith
Znuny newbie
Posts: 19
Joined: 22 Jul 2015, 10:49
Znuny Version: OTRS 4
Real Name: Muhammad Hassanine Haddad
Company: CIMEF

Re: [SOLVED] How can I use access control lists(ACLs) on dynamic fields?

Post by Smiith »

is that what it look like when i use ACL editor ? can someone help me or correct me please ?
You do not have the required permissions to view the files attached to this post.
RStraub
Znuny guru
Posts: 2210
Joined: 13 Mar 2014, 09:16
Znuny Version: 6.0.14
Real Name: Rolf Straub

Re: [SOLVED] How can I use access control lists(ACLs) on dynamic fields?

Post by RStraub »

What is your version? When I select "DynamicField" I get a dropdown and not a freetext.

I'd guess that you have to type there "NameOfYourField" and NOT "DynamicField_NameOfYourField" (atleast in the filter).
Currently using: OTRS 6.0.14 -- MariaDB -- Ubuntu 16 LTS
Smiith
Znuny newbie
Posts: 19
Joined: 22 Jul 2015, 10:49
Znuny Version: OTRS 4
Real Name: Muhammad Hassanine Haddad
Company: CIMEF

Re: [SOLVED] How can I use access control lists(ACLs) on dynamic fields?

Post by Smiith »

RStraub wrote:What is your version? When I select "DynamicField" I get a dropdown and not a freetext.

I'd guess that you have to type there "NameOfYourField" and NOT "DynamicField_NameOfYourField" (atleast in the filter).
it's OTRS 4.
I'm following the previous example of ACL about continent and country.
$Self->{TicketAcl}->{'100-continent-ACL'} = {
# match properties
Properties => {
# current ticket match properties
Frontend => {
Action => ['AgentTicketEmail'],
},
DynamicField => {
DynamicField_continent => ['africa'],

},
},
# return possible options (white list)
Possible => {
# possible ticket options (white list)
Ticket => {
DynamicField_country => ['kenya','uganda'],
},
},
};
If you talk about the DynamicField_continent it's a Dropdown i just chose "continent" and it written automatically DynamicField_continent
But if you talk about "DynamicField_country" yeah it's a Freetext, i wrote like DynamicField_continent, should i just write "continent" ?
RStraub
Znuny guru
Posts: 2210
Joined: 13 Mar 2014, 09:16
Znuny Version: 6.0.14
Real Name: Rolf Straub

Re: [SOLVED] How can I use access control lists(ACLs) on dynamic fields?

Post by RStraub »

No, it should be correct then.

And you can still select all values?
Make sure the ACL is deployed and that you are not using the root user (ACL don't apply for him).
Currently using: OTRS 6.0.14 -- MariaDB -- Ubuntu 16 LTS
Smiith
Znuny newbie
Posts: 19
Joined: 22 Jul 2015, 10:49
Znuny Version: OTRS 4
Real Name: Muhammad Hassanine Haddad
Company: CIMEF

Re: [SOLVED] How can I use access control lists(ACLs) on dynamic fields?

Post by Smiith »

RStraub wrote:No, it should be correct then.

And you can still select all values?
Make sure the ACL is deployed and that you are not using the root user (ACL don't apply for him).
what values ? sorry i did not understand what do you mean
ACL is deployed and i'm using another agent Admin, not the root i guess
Here what i did step by step:
1) first i created the Dynamic Fields
dynamic fields.png
2) then i configured the Frontend::Agent::Ticket::ViewEmailNew in SysConfig to be displayed in the New Email Ticket
sysconfig.png
3) finally i create the ACL like the previous photo
Did i made something wrong ? because the New Email Ticket still not displayed what i want. Still displayed All Countries when i chose North America like a Continent
new email ticket.png
Any help please ?
You do not have the required permissions to view the files attached to this post.
RStraub
Znuny guru
Posts: 2210
Joined: 13 Mar 2014, 09:16
Znuny Version: 6.0.14
Real Name: Rolf Straub

Re: [SOLVED] How can I use access control lists(ACLs) on dynamic fields?

Post by RStraub »

In your ACL your filter says action=AgentTicketEmailOutbound but when you create a new ticket the action "AgentTicketEmail".

So try removing the Outbound from the ACL filter and re-deploy.
Currently using: OTRS 6.0.14 -- MariaDB -- Ubuntu 16 LTS
Smiith
Znuny newbie
Posts: 19
Joined: 22 Jul 2015, 10:49
Znuny Version: OTRS 4
Real Name: Muhammad Hassanine Haddad
Company: CIMEF

Re: [SOLVED] How can I use access control lists(ACLs) on dynamic fields?

Post by Smiith »

RStraub wrote:In your ACL your filter says action=AgentTicketEmailOutbound but when you create a new ticket the action "AgentTicketEmail".

So try removing the Outbound from the ACL filter and re-deploy.
i tried but in Create New Email Ticket when i select a Continent it disappear suddenly
Country still display all the Countries
You do not have the required permissions to view the files attached to this post.
RStraub
Znuny guru
Posts: 2210
Joined: 13 Mar 2014, 09:16
Znuny Version: 6.0.14
Real Name: Rolf Straub

Re: [SOLVED] How can I use access control lists(ACLs) on dynamic fields?

Post by RStraub »

At least you know now that the ACL does something :)

As "Possible" is a whitelist (everything else is forbidden) you might want to add to your ACL:
Under Possible -> Ticket add:
DynamicField_continent
-> [regexp] .*
Currently using: OTRS 6.0.14 -- MariaDB -- Ubuntu 16 LTS
Smiith
Znuny newbie
Posts: 19
Joined: 22 Jul 2015, 10:49
Znuny Version: OTRS 4
Real Name: Muhammad Hassanine Haddad
Company: CIMEF

Re: [SOLVED] How can I use access control lists(ACLs) on dynamic fields?

Post by Smiith »

At least you know now that the ACL does something :)
hahaha yeah :D it worked finally :D
i think because of the change AgentTicketEmailOutbound to AgentTicketEmail
thank you very much everybody and especially RStraub :)
Nasirengg786
Znuny newbie
Posts: 6
Joined: 18 Nov 2015, 11:54
Znuny Version: 3.1.10
Real Name: Nasir Ali Shaikh
Company: Osource India

Re: [SOLVED] How can I use access control lists(ACLs) on dynamic fields?

Post by Nasirengg786 »

smuwanga wrote:Hello guys,

I have two dynamic fields, continent and country. On selecting a continent, its respective countries should show. However, the list of countries in my drop-down remains unchanged. What could I be doing wrong?

Here are my ACLs from Config.pm.

Code: Select all

#------------------ACLs----------------------------#
$Self->{TicketAcl}->{'100-continent-ACL'} = {
    # match properties
    Properties => {
        # current ticket match properties
        Ticket => {
            DynamicField_continent => ['Africa'],
        }
    },
    # return possible options (white list)
    Possible => {
        # possible ticket options (white list)
        Ticket => {
           DynamicField_country => ['Kenya','Uganda','South Africa'],
        },
    },
};
$Self->{TicketAcl}->{'101-continent-north-america-ACL'} = {
    # match properties
    Properties => {
        # current ticket match properties
        Ticket => {
            DynamicField_continent => ['North America'],
        }
    },
    # return possible options (white list)
    Possible => {
        # possible ticket options (white list)
        Ticket => {
           DynamicField_country => ['Canada','United States of America'],
        },
    },
};

$Self->{TicketAcl}->{'102-continent-Europe-ACL'} = {
    # match properties
    Properties => {
        # current ticket match properties
        Ticket => {
            DynamicField_continent => ['Europe'],
        }
    },
    # return possible options (white list)
    Possible => {
        # possible ticket options (white list)
        Ticket => {
           DynamicField_country => ['France'],
        },
    },
};
#------------end ACLs here-------------------------#
Thanking you,
Simon.
PLEASE HELP - WHERE TO DO THE CHANGES IN SYSTEM TO IMPLEMENT THIS -I AM UNABLE TO GET- WHEN I CHANGE CONFIG.PM - I M GETTING ENCOUNTER ERROR(MISCONFIGURATION) - PLEASE HELP - THANKS
Nasirengg786
Znuny newbie
Posts: 6
Joined: 18 Nov 2015, 11:54
Znuny Version: 3.1.10
Real Name: Nasir Ali Shaikh
Company: Osource India

Re: [SOLVED] How can I use access control lists(ACLs) on dynamic fields?

Post by Nasirengg786 »

RStraub wrote:At least you know now that the ACL does something :)

As "Possible" is a whitelist (everything else is forbidden) you might want to add to your ACL:
Under Possible -> Ticket add:
DynamicField_continent
-> [regexp] .*



PLEASE HELP - WHERE TO DO THE CHANGES IN SYSTEM TO IMPLEMENT THIS -I AM UNABLE TO GET- WHEN I CHANGE CONFIG.PM - I M GETTING ENCOUNTER ERROR(MISCONFIGURATION) - PLEASE HELP - THANKS
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: [SOLVED] How can I use access control lists(ACLs) on dynamic fields?

Post by reneeb »

YOU SHOULDN'T SCREAM AT US ;-)

Can you post the exact error message?
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
Locked