Source
'User with mixed permission on different triggers requests them with other triggers in editable mode' => [
<?php
/*
** Copyright (C) 2001-2025 Zabbix SIA
**
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
**
** This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
** without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
** See the GNU Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
require_once dirname(__FILE__).'/../include/CAPITest.php';
/**
* @onBefore prepareTestData
* @onAfter cleanTestData
*/
class testTriggerPermissions extends CAPITest {
public static function prepareTestData(): void {
CTestDataHelper::createObjects([
'template_groups' => [
['name' => 'ug1(W)ug2(R)ug3(D)ug4(N)']
],
'host_groups' => [
['name' => 'ug1(W)ug2(R)ug3(D)ug4(N)'],
['name' => 'hg.other'],
['name' => 'mht.hg1'],
['name' => 'mht.hg2'],
['name' => 'mht.hg3'],
['name' => 'mht.hg4'],
['name' => 'mht.hg.other']
],
'templates' => [
[
'host' => 't1',
'groups' => [
'groupid' => ':template_group:ug1(W)ug2(R)ug3(D)ug4(N)'
],
'items' => [
['key_' => 'i1']
]
]
],
'hosts' => [
[
'host' => 'h1',
'groups' => [
'groupid' => ':host_group:ug1(W)ug2(R)ug3(D)ug4(N)'
],
'items' => [
['key_' => 'i1']
]
],
[
'host' => 'mht.h1',
'groups' => [
'groupid' => ':host_group:mht.hg1'