Skip to content

Commit

Permalink
fix: more permission retrieval references
Browse files Browse the repository at this point in the history
Signed-off-by: Suhayb Wardany <me@suw.me>
  • Loading branch information
suwardany committed Sep 25, 2019
1 parent fabccf9 commit aae68ea
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/Permissions/StandardPermissions.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ protected function createPreparedPermissions(): array
{
$prepared = [];

if (! empty($this->secondaryPermissions)) {
foreach ($this->secondaryPermissions as $permissions) {
if (! empty($this->getSecondaryPermissions())) {
foreach ($this->getSecondaryPermissions() as $permissions) {
$this->preparePermissions($prepared, $permissions);
}
}

if (! empty($this->permissions)) {
if (! empty($this->getPermissions())) {
$permissions = [];

$this->preparePermissions($permissions, $this->permissions);
$this->preparePermissions($permissions, $this->getPermissions());

$prepared = array_merge($prepared, $permissions);
}
Expand Down
8 changes: 4 additions & 4 deletions src/Permissions/StrictPermissions.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ protected function createPreparedPermissions(): array
{
$prepared = [];

if (! empty($this->secondaryPermissions)) {
foreach ($this->secondaryPermissions as $permissions) {
if (! empty($this->getSecondaryPermissions())) {
foreach ($this->getSecondaryPermissions() as $permissions) {
$this->preparePermissions($prepared, $permissions);
}
}

if (! empty($this->permissions)) {
$this->preparePermissions($prepared, $this->permissions);
if (! empty($this->getPermissions())) {
$this->preparePermissions($prepared, $this->getPermissions());
}

return $prepared;
Expand Down
4 changes: 2 additions & 2 deletions tests/Permissions/PermissionsTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ protected function createPreparedPermissions()
{
$prepared = [];

if (! empty($this->secondaryPermissions)) {
foreach ($this->secondaryPermissions as $permissions) {
if (! empty($this->getSecondaryPermissions())) {
foreach ($this->getSecondaryPermissions() as $permissions) {
$this->preparePermissions($prepared, $permissions);
}
}
Expand Down

0 comments on commit aae68ea

Please sign in to comment.