Commit 8ca8562d authored by Jacob Priddy's avatar Jacob Priddy 👌
Browse files

use in array instead of foreach when looking for permission group

parent 2a0dbb3a
Pipeline #2293 passed with stages
in 1 minute and 52 seconds
......@@ -32,10 +32,8 @@ class DeleteGroup implements DeleteGroupUseCase
$reflection = new \ReflectionClass(Permissions::class);
foreach ($reflection->getConstants() as $constant) {
if ($group->getTitle() === $constant) {
throw new DeleteFailedException('Cannot delete a default permission group');
}
if (in_array($group->getTitle(), $reflection->getConstants(), true)) {
throw new DeleteFailedException('Cannot delete a default permission group');
}
if (!$this->groups->delete($groupId)) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment