Skip to content

Commit befb29b

Browse files
committed
fix overridden permissions with same name belonging to different role
1 parent 2e72477 commit befb29b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Kodeine/Acl/Traits/HasPermission.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,12 @@ function () {
5050
foreach ($role->getPermissions() as $slug => $array) {
5151
if (array_key_exists($slug, $permissions)) {
5252
foreach ($array as $clearance => $value) {
53-
if (array_key_exists($clearance, $permissions[$slug])) {
53+
if (! array_key_exists($clearance, $permissions[$slug])) {
5454
! $value ?: $permissions[$slug][$clearance] = true;
55+
} else {
56+
if ($permissions[$slug][$clearance] != $value) {
57+
$permissions[$slug][$clearance] = $value;
58+
}
5559
}
5660
}
5761
} else {

0 commit comments

Comments
 (0)