mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-08-19 00:58:34 +02:00
Added permission checking for part price edit page.
This commit is contained in:
parent
da14ee942d
commit
3374153b73
5 changed files with 101 additions and 10 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue