Skip to content

Commit

Permalink
keep wildcard "*" permission on sync
Browse files Browse the repository at this point in the history
  • Loading branch information
uyab committed Nov 27, 2019
1 parent 6211fa0 commit 62dbbeb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Acl.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ public function syncPermission($clean = false)
}

// delete unused permissions
$unusedPermissions = app(config('laravolt.acl.models.permission'))->whereNotIn('name', $this->permissions())->get();
$permissions = $this->permissions() + ['*'];
$unusedPermissions = app(config('laravolt.acl.models.permission'))->whereNotIn('name', $permissions)->get();
foreach ($unusedPermissions as $permission) {
$items->push(['id' => $permission->getKey(), 'name' => $permission->name, 'status' => 'Deleted']);
$permission->delete();
Expand Down

0 comments on commit 62dbbeb

Please sign in to comment.