Skip to content

Commit

Permalink
Added a validation for already existent resource, before add the reso…
Browse files Browse the repository at this point in the history
…urce.
  • Loading branch information
lotharthesavior committed Feb 6, 2018
1 parent fcdfa22 commit 9854744
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/AclRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ public function __construct(array $role, array $config = [])

if (isset($config['resources'])) {
foreach ($config['resources'] as $resource) {
if ($this->acl->hasResource($this->makeResource($resource))) {
continue;
}

$this->acl->addResource($this->makeResource($resource));
}
}
Expand Down

0 comments on commit 9854744

Please sign in to comment.