mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-12-26 12:59:31 +00:00
Check permissions for time travel and element undo.
This commit is contained in:
parent
254d4e6c69
commit
8a61b465d0
23 changed files with 370 additions and 90 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue