Skip to content

Commit cfdb51e

Browse files
committed
HP-2069: add access-subclients to role client
1 parent 928cea8 commit cfdb51e

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

src/files/items.php

+1
Original file line numberDiff line numberDiff line change
@@ -843,6 +843,7 @@
843843
'role:finance.user',
844844
'role:sale.user',
845845
'client.notify',
846+
'access-subclients',
846847
],
847848
],
848849
'role:support' => [

src/files/source/tree.php

+1
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@
357357
'role:finance.user',
358358
'role:sale.user',
359359
'client.notify',
360+
'access-subclients',
360361
],
361362
'role:support' => [
362363
'access-subclients', 'support',

tests/unit/CheckAccessTrait.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public function testAccessSubclients()
8787
$this->assertEqualsCanonicalizing($result, [
8888
'role:almighty', 'access-subclients',
8989
'role:support', 'role:admin', 'role:accounter', 'role:manager',
90-
'role:reseller', 'role:owner', 'role:junior-manager', 'role:staff-admin',
90+
'role:reseller', 'role:owner', 'role:junior-manager', 'role:staff-admin', 'role:client',
9191
]);
9292
}
9393

@@ -127,6 +127,7 @@ public function testClient()
127127
'request.read', 'request.create', 'request.update', 'request.delete',
128128
'vhost.read', 'vhost.create', 'vhost.update', 'vhost.delete',
129129
'ip.read', 'service.read', 'client.notify',
130+
'access-subclients',
130131
]);
131132
}
132133

@@ -533,7 +534,7 @@ public function testAlmighty()
533534

534535
public function testLimited()
535536
{
536-
$this->auth->setAssignments('role:client,deny:pay,deny:deposit,deny:domain.push,deny:server.pay,deny:server.read,deny:server.control-power,deny:server.control-system,deny:server.set-note,deny:ip.read,deny:service.read,deny:domain.delete-agp,deny:domain.set-nss', 'user:limited');
537+
$this->auth->setAssignments('role:client,deny:pay,deny:deposit,deny:domain.push,deny:server.pay,deny:server.read,deny:server.control-power,deny:server.control-system,deny:server.set-note,deny:ip.read,deny:service.read,deny:domain.delete-agp,deny:domain.set-nss,deny:access-subclients', 'user:limited');
537538

538539
$this->assertAccesses('user:limited', [
539540
'have-goods',
@@ -553,6 +554,7 @@ public function testLimited()
553554
'mail.read', 'mail.create', 'mail.update', 'mail.delete',
554555
'request.read', 'request.create', 'request.update', 'request.delete',
555556
'vhost.read', 'vhost.create', 'vhost.update', 'vhost.delete', 'client.notify',
557+
556558
]);
557559
}
558560

0 commit comments

Comments
 (0)