fix removing single permissions from event (#1661)

This commit is contained in:
Kevin Papst
2020-04-24 19:02:21 +02:00
committed by GitHub
parent 0debc70ead
commit cbd7124cec
2 changed files with 15 additions and 8 deletions

View File

@@ -36,8 +36,8 @@ final class PermissionsEvent extends Event
public function removePermission(string $section, string $permission): PermissionsEvent
{
if (\array_key_exists($section, $this->sections)) {
if (\array_key_exists($permission, $this->sections[$section])) {
unset($this->sections[$section][$permission]);
if (($key = array_search($permission, $this->sections[$section])) !== false) {
unset($this->sections[$section][$key]);
}
}