Categorias
< All Topics
Print

ACL – Criando e configurando Access Control Lists

Introdução

As ACL’s servem para incrementar o sistema de permissões do LigeroSmart. Com elas é possível restringir escolhas de atributos do ticket ou ações possíveis de serem tomadas de acordo com as propriedades atuais do mesmo (fila atual, estado etc).

O LigeroSmart conta com uma interface para criação e edição de ACLs – acesse Administração → Listas de Controle de Acesso

Adicione uma nova ACL clicando em “Criar nova ACL”.

Veja a seguir um exemplo de ACL que restringe um chamado de prioridade alta (5) para que seja permitido movê-lo apenas para uma fila chamada Alerta:

É possível notar que existem dois blocos de código neste exemplo acima. O primeiro com comentário “# match properties” é a definição das propriedades atuais do ticket, como se fosse um filtro onde definimos em que ocasiões essa ACL será aplicada.

No segundo bloco definimos as restrições ou permissões que os tickets que “cairem” nesta ACL sofrerão.

Preencha os campos a seguir:

Dicas:

  • As ACLs são interpretadas em ordem alfabética, por tanto, uma ACL que comece com a letra “Z” pode invalidar as condições de uma ACL que começa com a letra “A”.
  • Altere a validade da ACL para “Válido”

Após preencher esta tela, clique em Salvar.

Você terá então que começar a compor sua ACL na tela abaixo:

Exemplo 1:

Vamos entender a seguir, as seções que compõe uma ACL.

Seções compõe as ACLs

Properties

Aqui definimos os critérios, ou seja, o filtro que definirá se esta ACL será executada ou não. No exemplo abaixo, definimos que os chamados serão afetados caso o atendente selecione a prioridade ‘5 muito alta’ na tela em que está.

  Properties => {
    Ticket => {
    Priority => ['5 very high'],
    }
  },

PropertiesDatabase

Assim como “Properties”, esta seção é um filtro. A diferença entre ambas é que Properties realiza a comparação com os valores que estão na tela, durante uma modificação por exemplo de valores, reclassificação de chamados etc, enquanto PropertiesDatabase realiza uma comparação com as informações que estão no banco de dados do chamado. No exemplo abaixo, os chamados que possuem prioridade muito alta serão afetados, independentemente das alterações em curso na tela.

  PropertiesDatabase => {
    Ticket => {
    Priority => ['5 very high'],
    }
  },

Possible

Define quais são os valores que poderão ser escolhidos. Outros valores serão excluídos da exibição. No exemplo abaixo, os chamados que corresponderem aos critérios definidos em Properties ou PropertiesDatabase, poderão apenas serem movidos para a fila ‘Alerta’ e para nenhuma outra. Lembrando que aqui estamos restringindo apenas a fila para onde ele poderá ser movido, todas as outras funções tais como criar nota, responder, bloquear, não são afetadas.

  Possible => {
    Ticket => {
      Queue => ['Alerta'],
    },
  },

PossibleNot

Define os valores que não poderão ser exibidos. Todos os outros valores serão. No exemplo abaixo, os chamados poderão ser movidos para quaisquer filas, menos para a fila Alerta.

  PossibleNot => {
    Ticket => {
      Queue => ['Alerta'],
    },
  },

Exemplo 2:

Vamos simular então uma ACL onde o atendente nunca poderá fechar um chamado se o mesmo estiver na fila Raw com prioridade 5. Ficaria assim:

Code exemplo 2:

# ticket acl
$Self->{TicketAcl}->{'ACL-Alerta5'} = {
  # 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 => ['Raw'],
    },
    Action => {
      AgentTicketClose => 0,
    },
  },
  PossibleNot => {
    # possible not ticket options
    Ticket => {
        State => ['closed successful','closed unsuccessful'],
    },	  
  },
};

PossibleAdd

Adiciona valores possíveis a um atributo, sem ser restritivo. Um exemplo: permitir que um usuário encerre o chamado apenas após este ser classificado:

  1. Crie uma ACL que retire os estados “[RegExp]^closed” usando o PossibleNot.
  2. Crie uma ACL que adiciona os mesmos estados usando o PossibleAdd, quando o serviço for definido.


Propriedades

Action

No exemplo acima, vimos o elemento “Action”. Ele define se uma tela do sistema ficará disponível ou não para o atendente. Porém, ela deve ser declarada apenas na seção “Possible”, mesmo que o objetivo seja negar a exibição do módulo. Para habilitar, coloque o valor 1, para negar, coloque o valor 0, como no exemplo acima:

    Action => {
      AgentTicketClose => 0,
    },

Expressões Regulares

Também é possível utilizar expressões regulares. No exemplo abaixo (retirado da documentação oficial), exibimos apenas serviços que comecem com a palavra “Hardware”, para um ticket estiver na fila HW ou uma de suas subfilas:

$Self->{TicketAcl}->{'100-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)'],
            },
        },
    };

Vale a pena lembrar que os serviços começados com a palavra “Hardware” continuaram sendo exibidos em outras filas. Foi utilizando esse tipo de ACL que construí um módulo que permite escolher os serviços que queremos exibir em cada uma das filas do sistema.

Parâmetros Possíveis

  ConfigMatch:
    Properties:
      # Match properties (current values from the form).
      CustomerUser:
        UserLogin:
        - some login
        UserCustomerID:
        - some customer ID
        Group_rw:
        - some group
      DynamicField:
        # Names must be in DynamicField_<field_name> format.
        # Values for dynamic fields must always be the untranslated internal
        #   data keys specified in the dynamic field definition and not the
        #   data values shown to the user.
        # Using the key is also mandatory for dynamic field of type database
        #   and dynamic field of type web service.
        DynamicField_Field1:
        - some value
        DynamicField_OtherField:
        - some value
        DynamicField_TicketFreeText2:
        - some value
        # more dynamic fields
      Frontend:
        Endpoint:
        - AgentFrontend::PersonalPreferences
        - AgentFrontend::ProcessTicketNextStep
        - AgentFrontend::Ticket::Action::Close
        - AgentFrontend::Ticket::Action::Customer
        - AgentFrontend::Ticket::Action::EmailOutbound
        - AgentFrontend::Ticket::Action::FreeText
        - AgentFrontend::Ticket::Action::Link
        - AgentFrontend::Ticket::Action::Lock
        - AgentFrontend::Ticket::Action::Merge
        - AgentFrontend::Ticket::Action::Move
        - AgentFrontend::Ticket::Action::Note
        - AgentFrontend::Ticket::Action::Owner
        - AgentFrontend::Ticket::Action::Pending
        - AgentFrontend::Ticket::Action::PhoneCallInbound
        - AgentFrontend::Ticket::Action::PhoneCallOutbound
        - AgentFrontend::Ticket::Action::Print
        - AgentFrontend::Ticket::Action::Priority
        - AgentFrontend::Ticket::Action::Process
        - AgentFrontend::Ticket::Action::Redirect
        - AgentFrontend::Ticket::Action::Responsible
        - AgentFrontend::Ticket::Action::SmsOutbound
        - AgentFrontend::Ticket::Action::TicketHistory
        - AgentFrontend::Ticket::Action::Unlock
        - AgentFrontend::Ticket::Action::Unwatch
        - AgentFrontend::Ticket::Action::Watch
        - AgentFrontend::Ticket::InlineEditing::Property::CustomerUserID
        - AgentFrontend::Ticket::InlineEditing::Property::Lock
        - AgentFrontend::Ticket::InlineEditing::Property::Owner
        - AgentFrontend::Ticket::InlineEditing::Property::Priority
        - AgentFrontend::Ticket::InlineEditing::Property::Queue
        - AgentFrontend::Ticket::InlineEditing::Property::Responsible
        - AgentFrontend::Ticket::InlineEditing::Property::Service
        - AgentFrontend::Ticket::InlineEditing::Property::State
        - AgentFrontend::Ticket::InlineEditing::Property::Type
        - AgentFrontend::Ticket::InlineEditing::Property::Watch
        - AgentFrontend::TicketArticle::Action::CopyLink
        - AgentFrontend::TicketArticle::Action::Forward
        - AgentFrontend::TicketArticle::Action::MarkAsImportant
        - AgentFrontend::TicketArticle::Action::MessageLog
        - AgentFrontend::TicketArticle::Action::Plain
        - AgentFrontend::TicketArticle::Action::Print
        - AgentFrontend::TicketArticle::Action::Redirect
        - AgentFrontend::TicketArticle::Action::Reply
        - AgentFrontend::TicketArticle::Action::ReplyAll
        - AgentFrontend::TicketArticle::Action::ReplyToNote
        - AgentFrontend::TicketArticle::Action::ReplyViaSms
        - AgentFrontend::TicketArticle::Action::Split
        - AgentFrontend::TicketArticle::Action::UnmarkAsImportant
        - AgentFrontend::TicketCreate::Email
        - AgentFrontend::TicketCreate::Phone
        - AgentFrontend::TicketCreate::Process
        - AgentFrontend::TicketCreate::SMS
        - AgentFrontend::TicketDetailView
        - AgentFrontend::TicketDetailView::Property
        - AgentFrontend::TicketList::Bulk
        - AgentFrontend::TicketList::Filters
        - ...
        - ExternalFrontend::PersonalPreferences
        - ExternalFrontend::ProcessTicketCreate
        - ExternalFrontend::ProcessTicketNextStep
        - ExternalFrontend::Ticket::ExportList
        - ExternalFrontend::Ticket::List
        - ExternalFrontend::Ticket::Print
        - ExternalFrontend::TicketCreate
        - ExternalFrontend::TicketDetailView
        - ...
      Owner:
        UserLogin:
        - some login
        Group_rw:
        - some group
        Role:
        - admin
        # more owner attributes
      Priority:
        ID:
        - some ID
        Name:
        - some name
        # more priority attributes
      Process:
        ProcessEntityID:
        # the process that the current ticket is part of
        - Process-9c378d7cc59f0fce4cee7bb9995ee3eb
        ActivityEntityID:
        # the current activity of the ticket
        - Activity-f8b2fdebe54eeb7b147a5f8e1da5e35c
        ActivityDialogEntityID:
        # the current activity dialog that the agent/customer is using
        - ActivityDialog-aff0ae05fe6803f38de8fff6cf33b7ce
      Queue:
        Name:
        - Raw
        QueueID:
        - some ID
        GroupID:
        - some ID
        Email:
        - some email
        RealName:
        - OTRS System
        # more queue attributes
      Responsible:
        UserLogin:
        - some login
        Group_rw:
        - some group
        Role:
        - admin
        # more responsible attributes
      Service:
        ServiceID:
        - some ID
        Name:
        - some name
        ParentID:
        - some ID
        # more service attributes
      SLA:
        SLAID:
        - some ID
        Name:
        - some name
        Calendar:
        - some calendar
        # more SLA attributes
      State:
        ID:
        - some ID
        Name:
        - some name
        TypeName:
        - some state type name
        TypeID:
        - some state type ID
        # more state attributes
      Ticket:
        Queue:
        - Raw
        State:
        - new
        - open
        Priority:
        - some priority
        Lock:
        - lock
        CustomerID:
        - some ID
        CustomerUserID:
        - some ID
        Owner:
        - some owner
        DynamicField_Field1:
        - some value
        DynamicField_MyField:
        - some value
        # more ticket attributes
      Type:
        ID:
        - some ID
        Name:
        - some name
        # more type attributes
      User:
        UserLogin:
        - some_login
        Group_rw:
        - some group
        Role:
        - admin
    PropertiesDatabase:
      # Match properties (existing values from the database).
      # Please note that Frontend is not in the database, but in the framework.
      # See section "Properties", the same configuration can be used here.
  ConfigChange:
    Possible:
      # Reset possible options (white list).
      Action:
      # Possible action options (white list).
      - ...
      ActivityDialog:
      # Limit the number of possible activity dialogs the agent/customer can use in a process ticket.
      - ActivityDialog-aff0ae05fe6803f38de8fff6cf33b7ce
      - ActivityDialog-429d61180a593414789a8087cc4b3c6f
      - ...
      Endpoint:
      # Limit the functions on agent interface.
      - AgentFrontend::PersonalPreferences
      - AgentFrontend::ProcessTicketNextStep
      - AgentFrontend::Ticket::Action::Close
      - AgentFrontend::Ticket::Action::Customer
      - AgentFrontend::Ticket::Action::EmailOutbound
      - AgentFrontend::Ticket::Action::FreeText
      - AgentFrontend::Ticket::Action::Link
      - AgentFrontend::Ticket::Action::Lock
      - AgentFrontend::Ticket::Action::Merge
      - AgentFrontend::Ticket::Action::Move
      - AgentFrontend::Ticket::Action::Note
      - AgentFrontend::Ticket::Action::Owner
      - AgentFrontend::Ticket::Action::Pending
      - AgentFrontend::Ticket::Action::PhoneCallInbound
      - AgentFrontend::Ticket::Action::PhoneCallOutbound
      - AgentFrontend::Ticket::Action::Print
      - AgentFrontend::Ticket::Action::Priority
      - AgentFrontend::Ticket::Action::Process
      - AgentFrontend::Ticket::Action::Redirect
      - AgentFrontend::Ticket::Action::Responsible
      - AgentFrontend::Ticket::Action::SmsOutbound
      - AgentFrontend::Ticket::Action::TicketHistory
      - AgentFrontend::Ticket::Action::Unlock
      - AgentFrontend::Ticket::Action::Unwatch
      - AgentFrontend::Ticket::Action::Watch
      - AgentFrontend::Ticket::InlineEditing::Property::CustomerUserID
      - AgentFrontend::Ticket::InlineEditing::Property::Lock
      - AgentFrontend::Ticket::InlineEditing::Property::Owner
      - AgentFrontend::Ticket::InlineEditing::Property::Priority
      - AgentFrontend::Ticket::InlineEditing::Property::Queue
      - AgentFrontend::Ticket::InlineEditing::Property::Responsible
      - AgentFrontend::Ticket::InlineEditing::Property::Service
      - AgentFrontend::Ticket::InlineEditing::Property::State
      - AgentFrontend::Ticket::InlineEditing::Property::Type
      - AgentFrontend::Ticket::InlineEditing::Property::Watch
      - AgentFrontend::TicketArticle::Action::CopyLink
      - AgentFrontend::TicketArticle::Action::Forward
      - AgentFrontend::TicketArticle::Action::MarkAsImportant
      - AgentFrontend::TicketArticle::Action::MessageLog
      - AgentFrontend::TicketArticle::Action::Plain
      - AgentFrontend::TicketArticle::Action::Print
      - AgentFrontend::TicketArticle::Action::Redirect
      - AgentFrontend::TicketArticle::Action::Reply
      - AgentFrontend::TicketArticle::Action::ReplyAll
      - AgentFrontend::TicketArticle::Action::ReplyToNote
      - AgentFrontend::TicketArticle::Action::ReplyViaSms
      - AgentFrontend::TicketArticle::Action::Split
      - AgentFrontend::TicketArticle::Action::UnmarkAsImportant
      - AgentFrontend::TicketCreate::Email
      - AgentFrontend::TicketCreate::Phone
      - AgentFrontend::TicketCreate::Process
      - AgentFrontend::TicketCreate::SMS
      - AgentFrontend::TicketDetailView
      - AgentFrontend::TicketDetailView::Property
      - AgentFrontend::TicketList::Bulk
      - AgentFrontend::TicketList::Filters
      - ...
      # Limit the functions on external interface.
      - ExternalFrontend::PersonalPreferences
      - ExternalFrontend::ProcessTicketCreate
      - ExternalFrontend::ProcessTicketNextStep
      - ExternalFrontend::Ticket::ExportList
      - ExternalFrontend::Ticket::List
      - ExternalFrontend::Ticket::Print
      - ExternalFrontend::TicketCreate
      - ExternalFrontend::TicketDetailView
      - ...
      Process:
      # Limit the number of possible processes that can be started.
      - Process-9c378d7cc59f0fce4cee7bb9995ee3eb
      - Process-12345678901234567890123456789012
      - ...
      Ticket:
      # Possible ticket options (white list).
        Queue:
        - Raw
        - some other queue
        State:
        - some state
        Priority:
        - 5 very high
        DynamicField_Field1:
        - some value
        DynamicField_MyField:
        - some value
        # more dynamic fields
        NewOwner:
        # For ticket action screens, where the Owner is already set.
        - some owner
        OldOwner:
        # For ticket action screens, where the Owner is already set.
        - some owner
        Owner:
        # For ticket create screens, because Owner is not set yet.
        - some owner
        # more ticket attributes
    PossibleAdd:
       # Add options (white list).
       # See section "Possible", the same configuration can be used here.
    PossibleNot:
       # Remove options (black list).
       # See section "Possible", the same configuration can be used here.
  CreateBy: root@localhost
  CreateTime: 2020-04-15 16:46:23
  Description: This is the long description of the ACL to explain its usage.
  ID: 1
  Name: 200-ACL-Reference
  StopAfterMatch: 0
  ValidID: 3
Anterior Bloquear certos chamados de ficarem visíveis aos clientes
Próxima Configurando a autenticação OAuth2 para e-mail no LigeroSmart

Deixe uma resposta

O seu endereço de e-mail não será publicado. Campos obrigatórios são marcados com *

Sumário