Skip to content

Commit

Permalink
added bill.read permission to clients
Browse files Browse the repository at this point in the history
  • Loading branch information
hiqsol committed Dec 11, 2017
1 parent 96640cc commit b0c8b34
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/Initer.php
Expand Up @@ -23,6 +23,7 @@ class Initer
],
'role:client' => [
'role:unauthorized',
'bill.read',
'domain.pay', 'domain.push',
'server.pay',
],
Expand Down
7 changes: 4 additions & 3 deletions src/files/items.php
Expand Up @@ -11,6 +11,7 @@
'type' => 1,
'children' => [
'role:unauthorized',
'bill.read',
'domain.pay',
'domain.push',
'server.pay',
Expand Down Expand Up @@ -145,6 +146,9 @@
'deposit' => [
'type' => 2,
],
'bill.read' => [
'type' => 2,
],
'domain.pay' => [
'type' => 2,
],
Expand All @@ -166,9 +170,6 @@
'manage' => [
'type' => 2,
],
'bill.read' => [
'type' => 2,
],
'mailing.prepare' => [
'type' => 2,
],
Expand Down
5 changes: 3 additions & 2 deletions tests/unit/CheckAccessTrait.php
Expand Up @@ -65,6 +65,7 @@ public function testClient()
$this->assertAccesses('role:client', [
'restore-password', 'deposit',
'domain.pay', 'domain.push', 'server.pay',
'bill.read',
]);
}

Expand Down Expand Up @@ -95,6 +96,7 @@ public function testEmployee()
$this->assertAccesses('role:employee', [
'restore-password', 'deposit',
'domain.pay', 'domain.push', 'server.pay',
'bill.read',
'employee.read',
]);
}
Expand Down Expand Up @@ -122,8 +124,7 @@ public function testDeny()
$this->auth->setAssignments('role:client,deny:deposit,deny:domain.push,deny:server.pay', 'user:limited');

$this->assertAccesses('user:limited', [
'restore-password',
'domain.pay',
'restore-password', 'domain.pay', 'bill.read',
]);
}

Expand Down

0 comments on commit b0c8b34

Please sign in to comment.