Added permission checking for part price edit page.

This commit is contained in:
Jan Böhmer 2019-09-13 17:46:26 +02:00
parent da14ee942d
commit 3374153b73
5 changed files with 101 additions and 10 deletions

View file

@ -56,9 +56,11 @@ class StructureVoter extends ExtendedVoter
*/
protected function supports($attribute, $subject)
{
$permission_name = $this->instanceToPermissionName($subject);
//If permission name is null, then the subject is not supported
return ($permission_name !== null) && $this->resolver->isValidOperation($permission_name, $attribute);
if(is_object($subject)) {
$permission_name = $this->instanceToPermissionName($subject);
//If permission name is null, then the subject is not supported
return ($permission_name !== null) && $this->resolver->isValidOperation($permission_name, $attribute);
}
}