访问控制列表(ACL)¶
使用工单可能会成为一项令人困惑的任务。有许多选项用于处理或关闭工单,即使在工单的当前状态下或由于当前服务人员的角色而不需要它们。隐藏不需要的菜单项会清理菜单栏,使其更易于使用;隐藏动态字段或下一个队列的值会降低人为错误的可能性。
OTRS使用访问控制列表(ACL)来限制服务人员和客户用户的工单选项,只允许使用工单进行正确且有意义的活动。 OTRS管理员可以在图形界面中轻松生成ACL,以防止在满足特定要求之前关闭工单,防止在添加定义的信息之前将工单移动到队列,等等。
使用此屏幕管理系统中的访问控制列表。默认情况下,新的OTRS安装不包含访问控制列表。访问控制列表管理屏幕在 流程和自动化 组的 访问控制列表(ACL) 模块中可用。

ACL管理屏幕
管理访问控制列表¶
注解
在创建一些访问控制列表时,请记住它们是按照访问控制列表概览中显示的字母顺序执行的。
警告
超级用户帐户(UserID 1)将忽略ACL限制。
若要创建一个新的ACL:
- 点击左侧边栏中的 创建ACL 按钮。
- 填写必填字段。
- 点击 保存 按钮。
- 您将会被重定向到 编辑ACL 屏幕来编辑ACL结构。

创建ACL屏幕
若要编辑一个ACL:
- 点击ACL列表中的一个ACL,或者您已经从 创建ACL 屏幕重定向到此处。
- 修改字段和ACL结构。
- 点击 保存 或 保存并完成 按钮。
- 部署所有ACL。

编辑ACL结构屏幕
若要删除一个ACL:
- 点击ACL列表中的一个ACL。
- 将 有效性 选项设置为 无效 或 临时无效。
- 点击 保存 按钮。在左侧边栏中将出现一个新的 删除无效的ACL 按钮。
- 点击 删除无效的ACL 按钮。
- 点击确认屏幕中的 删除 按钮。
- 部署所有ACL。
警告
ACL以Perl格式写入 zzzacl.pm
文件。在不部署的情况下,即使删除了所有ACL或将 有效性 选项设置为 无效 或 临时无效,所有ACL仍在此缓存文件中。不要忘记在修改后部署所有ACL!
若要部署所有ACL:
- 点击左侧边栏的 部署ACL 按钮。
注解
为了影响系统的行为,必须部署新的或修改过的ACL。将 有效性 选项设置为 有效 只表示应该部署哪些ACL。
若要导出所有ACL:
- 点击左侧边栏的 导出ACL 按钮。
- 在计算机中选择一个位置以保存
Export_ACL.yml
文件。
若要导入ACL:
- 点击左侧边栏的 浏览… 按钮。
- 选择一个先前导出的
.yml
文件。 - 如果您想覆盖现有的ACL,点击 覆盖现有的ACL吗? 复选框。
- 点击 导入ACL配置 按钮。
- 点击 部署ACL 按钮部署导入的ACL。
注解
如果系统中添加了多个ACL,请使用过滤器框通过键入要过滤的名称来查找特定ACL。
警告
The maximum number of 80 valid ACLs should not be exceeded. Exceeding this limit may affect the system performance.
警告
应谨慎更改此对象的名称,该检查仅提供对某些设置的验证,并忽略无法验证名称的内容。一些例子包括仪表板过滤器、访问控制列表(ACL)和流程(序列流操作)。您的设置文档是名称更改后生存的关键。
Possible Data Loss¶
警告
If a drop-down field has a value that is forbidden by ACL, the stored value in a ticket will be changed or removed after the form is submitted. This can cause possible data loss!
Here is an example to explain the possible problems:
A drop-down dynamic field is created with four possible values: BRONZE, SILVER, GOLD and VIP. Empty value also allowed. The agent can select BRONZE, SILVER and GOLD only. The VIP value can be set only by the generic agent. This is restricted by an ACL. The dynamic field is added to some ticket screens. In a screen the field is set as mandatory but in another screen the field is not mandatory and empty value is allowed.
- The agent creates a new ticket. The agent can select only the allowed values, the VIP value is not displayed. SILVER is selected and the ticket is created.
- The generic agent changes the value to VIP.
- The agent opens a ticket action where the field is added as mandatory. Since the field is mandatory the agent has to select an other value instead of VIP which is not visible to the agent due to an ACL rule. The form is submitted and the dynamic field value is changed. This can be an unintended change.
- The generic agent changes the value to VIP again.
- The agent opens a ticket action where the field is added as optional. The field shows an empty value because the current VIP value is not visible to the agent. Since the field is not mandatory the agent does not change the value and leaves it empty. The form is submitted and the dynamic field value is changed to empty value. This can be a possible data loss.
Be careful of unintended data change! The same situation can happen with dynamic fields, priorities, queues, states, types and any other drop-down fields that are forbidden by ACLs.
ACL设置¶
添加或编辑此资源时,可以使用以下设置。 标有星号的字段是必填字段。
- 名称 *
- 此资源的名称。 可以在此字段中输入任何类型的字符,包括大写字母和空格。 名称将显示在概览表中。
- 注释
- 向此资源添加其它信息。 为了更清晰,建议始终将此字段填充为带有完整句子的资源描述,因为注释也将显示在概览表中。
- 描述
- 类似于注释,但可以在此处添加较长的文本。
- 匹配后停止
- ACL按字母顺序进行评估。此设置禁止后续的ACL评估。
- 有效性 *
- 设置此资源的有效性。 如果此字段设置为 有效,则每个资源即可仅在OTRS中使用。 将此字段设置为 无效 或 临时无效 将禁止此资源的使用。
编辑ACL结构¶
The ACL definition can be split into two big parts, Match settings and Change settings.
Match Settings¶
In the match settings the ACLs contain attributes that has to be met in order to use the ACL. If an ACL contains more than one attribute then all attributes have to be met. If the attributes defined in the ACL do not match with the attributes that are sent, then the ACL does not take any affect, but any other match ACL will.
Properties(属性)
- 本部分包含可动态修改的匹配选项。例如:在一个工单创建时随着服务人员设置工单信息而动态修改工单数据。如果一条ACL匹配了一个工单属性,则只有当匹配的属性被选择时ACL将会激活并可能减少其它的工单属性,但只要选择了另一个值,ACL就不会产生任何影响。
PropertiesDatabase(在数据库中的属性)
- 本部分类似于
Properties(属性)
,但不会更改未保存到数据库中的工单属性,这意味着更改未提交的属性不会产生任何影响。 本部分不用于工单创建屏幕(因为尚未在数据库中创建工单)。
Change Settings¶
The change settings contain the rules to reduce the possible options for a ticket.
Possible(可能的)
- 本部分用于将要减少的数据重置为仅在本部分中设置的元素。
PossibleAdd(可增加的)
- 本部分用于添加在其他ACL中减少的缺失元素。本部分仅与具有
Possible(可能的)
或PossibleNot(不可能的)
部分的其他ACL一起使用。 PossibleNot(不可能的)
- 本部分用于从当前数据中删除特定元素。它可以单独使用,也可以与其他具有
Possible(可能的)
或PossibleNot(不可能的)
部分的ACL一起使用。
修饰符¶
为了使ACL的开发更容易且更强大,每个部分还有一些所谓的属性‘修饰符’。这个修饰符的解释如下:
[Not]
- 此修饰符用于否定值,例如
[Not] 2 low
。 用于优先级时与这些是相同的:1 very low、 3 normal、4 high、 5 very high。 [RegExp]
- 它用于定义匹配多个值的正则表达式,例如
[RegExp]low
。在这种情况下,用于优先级时与 1 very low、 2 low 相同。 [regexp]
- 它与``[RegExp]`` 非常相似,但不区分大小写。
[NotRegExp]
- 否定正则表达式,例如
[NotRegExp]low
。用于优先级时与 3 normal、4 high、5 very high 相同。 [Notregexp]
- 它与
[NotRegExp]
非常相似,但不区分大小写。
ACL范例¶
根据优先级将工单移动到队列¶
这个例子向您展示了如何允许移动优先级是 5 very high 的工单到某个队列中。
首先,它需要有一个名字。 在这里,叫做 100-Example-ACL。 请注意,ACL将在执行前进行数字排序,因此您应该仔细使用这些名称。 注释和描述字段是可选的。

100-Example-ACL - 基本设置
其次,有一个 属性 部分,它是你的工单的过滤器。 此处定义的所有条件都将应用于工单,以确定是否必须应用ACL。 在我们的示例中,如果工单位于队列 Raw 并且优先级为 5 very high,则将匹配。 这也受到在表单中更改的影响(例如,如果是是队列为 Raw 并且优先级为 3 normal 时ACL将不匹配,但是然后选择优先级下拉列表并更改优先级为 5 very high,然后也将匹配)。

100-Example-ACL - 匹配设置
最后,Possible(可能的) 部分定义了对屏幕的修改。 在本示例中,工单屏幕从可用的队列中只能选择 Alert 队列。

100-Example-ACL - 更改设置
注解
不要忘记将 有效性 设置为 有效 并部署新创建的ACL。
根据存储在数据库中的优先级将工单移动到队列¶
本示例与第一个示例非常相似,但在这个示例中,只有 Raw 队列中且优先级为 5 very high 的工单,两者都存储在数据库中时才会匹配。 在数据库中实际更新工单之前,此类ACL不考虑在表单中的更改。

101-Example-ACL
在队列中禁用关闭工单并隐藏关闭按钮¶
本示例显示如何禁用队列 Raw 中的关闭工单,并隐藏关闭按钮。 可以过滤具有多个可能值的工单字段(状态)以供选择。 还可以限制能够对特定工单执行的动作。 在本示例中,无法关闭工单。

102-Example-ACL
移除状态¶
本示例显示了如何定义否定过滤器(状态 成功关闭 将被删除)。 您还可以看到,未定义工单的匹配属性将匹配任何工单,即会始终应用ACL。 如果您希望默认隐藏某些值,并且仅在特殊情况下启用它们(例如,如果服务人员位于一个特定组中),则此选项可能很有用。

103-Example-ACL
ACL 参考¶
可在ACL中使用的属性、键和值在很大程度上取决于 OTRS 安装。 例如,可以通过安装扩展模块来扩展可能的值,并且它可以取决于在 Config.pm
中设置的客户用户映射。 因此,无法提供包含所有设置的完整的 ACL 参考。
有关可在 ACL 中使用的属性、键和值,请参阅以下 YAML 格式的 ACL 示例 。
---
- ChangeBy: root@localhost
ChangeTime: 2019-01-07 10:42:59
Comment: ACL Reference.
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:
Action:
- AgentTicketPhone
- AgentTicketEmail
- ...
Endpoint:
- ExternalFrontend::PersonalPreferences
- ExternalFrontend::ProcessTicketCreate
- ExternalFrontend::ProcessTicketNextStep
- 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).
- AgentTicketBounce
- AgentTicketPhone # only used to show/hide the Split action
- AgentLinkObject # only used to show/hide the Link action
- ...
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 external interface.
- ExternalFrontend::PersonalPreferences
- ExternalFrontend::ProcessTicketCreate
- ExternalFrontend::ProcessTicketNextStep
- 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).
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
Priority:
- 5 very high
Queue:
- Raw
- some other queue
Service:
- some service
ServiceID:
- some service ID
SLA:
- some SLA
SLAID:
- some SLA ID
State:
- some state
StateID:
- some state ID
# 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: 2019-01-07 10:42:59
Description: This is the long description of the ACL to explain its usage.
ID: 1
Name: 200-ACL-Reference
StopAfterMatch: 0
ValidID: 3