Example 18.1. ACL allowing movement into a queue of only those tickets with ticket priority 5.
This example shows you the basic structure of an ACL. First, it needs to have a name. In this case, it is "ACL-Name-2". Note that the ACLs will be numerically sorted before execution, so you should use the names carefully.
Secondly, you have a "Properties" section which is a filter for your tickets. All the criteria defined here will be applied to a ticket to determine if the ACL must be applied or not. In our example, a ticket will match if it is in the queue "Raw" and has priority "5 very high".
Lastly, a section "Possible" defines modifications to the screens. In this case, from the available queues, only the queue "Alert" can be selected in a ticket screen.
# ticket acl $Self->{TicketAcl}->{'100-Example-ACL'} = { # match properties Properties => { # current ticket match properties Ticket => { Queue => ['Raw'], Priority => ['5 very high'], } }, # return possible options (white list) Possible => { # possible ticket options (white list) Ticket => { Queue => ['Alert'], }, }, };
Example 18.2. ACL disabling the closing of tickets in the raw queue, and hiding the close button.
Here you can see how a ticket field (state) can be filtered with more than one possible value to select from. It is also possible to limit the actions that can be executed for a certain ticket. In this case, the ticket cannot be closed.
$Self->{TicketAcl}->{'101-Second-Example-ACL'} = { # match properties Properties => { # current ticket match properties Ticket => { Queue => ['Raw'], } }, # return possible options (white list) Possible => { # possible ticket options (white list) Ticket => { State => ['new', 'open', 'pending reminder'], }, # possible action options Action => { AgentTicketBounce => 1, AgentTicketClose => 0, AgentTicketCompose => 1, AgentTicketCustomer => 1, AgentTicketForward => 1, AgentTicketFreeText => 1, AgentTicketHistory => 1, AgentTicketLink => 1, AgentTicketLock => 1, AgentTicketMerge => 1, AgentTicketMove => 1, AgentTicketNote => 1, AgentTicketOwner => 1, AgentTicketPending => 1, AgentTicketPhone => 1, # only used to hide the Split action AgentTicketPhoneInbound => 1, AgentTicketPhoneOutbound => 1, AgentTicketPrint => 1, AgentTicketPriority => 1, AgentTicketResponsible => 1, AgentTicketWatcher => 1, AgentTicketZoom => 1, AgentLinkObject => 1, # only used to hide the Link action }, }, };
Example 18.3. ACL removing always state closed successful.
This example shows how it is possible to define negative filters (the state "closed successful" will be removed). You can also see that not defining match properties for a ticket will match any ticket, i. e. the ACL will always be applied. This may be useful if you want to hide certain values by default, and only enable them in special circumstances (e. g. if the agent is in a specific group).
$Self->{TicketAcl}->{'102-Third-ACL-Example'} = { # match properties Properties => { # current ticket match properties (match always) }, # return possible options PossibleNot => { # possible ticket options Ticket => { State => ['closed successful'], }, }, };
Example 18.4. ACL only showing Hardware services for tickets that are created in queues that start with "HW".
This example also shows you how you can use regular expressions for matching tickets and for filtering the available options.
$Self->{TicketAcl}->{'Only-Hardware-Services-for-HW-Queues'} = { # match properties # note we don't have "Ticket => {" because there's no ticket yet Properties => { Queue => { Name => ['[RegExp]HW'], } }, # return possible options Possible => { # possible ticket options Ticket => { Service => ['[RegExp]^(Hardware)'], }, }, };