Check permissions for time travel and element undo.

This commit is contained in:
Jan Böhmer 2020-03-07 20:49:52 +01:00
parent 254d4e6c69
commit 8a61b465d0
23 changed files with 370 additions and 90 deletions

View file

@ -57,11 +57,7 @@ class GroupVoter extends ExtendedVoter
*/
protected function voteOnUser($attribute, $subject, User $user): bool
{
if ($subject instanceof Group) {
return $this->resolver->inherit($user, 'groups', $attribute) ?? false;
}
return false;
return $this->resolver->inherit($user, 'groups', $attribute) ?? false;
}
/**
@ -74,7 +70,7 @@ class GroupVoter extends ExtendedVoter
*/
protected function supports($attribute, $subject)
{
if ($subject instanceof Group) {
if (is_a($subject, Group::class, true)) {
return $this->resolver->isValidOperation('groups', $attribute);
}