mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-01 14:04:30 +02:00
Fixed coding style.
This commit is contained in:
parent
e9493e52ec
commit
f5d685dfd4
71 changed files with 619 additions and 531 deletions
|
@ -1,4 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
|
||||
*
|
||||
|
@ -20,13 +23,11 @@
|
|||
|
||||
namespace App\Security\Voter;
|
||||
|
||||
|
||||
use App\Entity\LabelSystem\LabelProfile;
|
||||
use App\Entity\UserSystem\User;
|
||||
|
||||
class LabelProfileVoter extends ExtendedVoter
|
||||
{
|
||||
|
||||
protected const MAPPING = [
|
||||
'read' => 'read_profiles',
|
||||
'create' => 'create_profiles',
|
||||
|
@ -36,21 +37,15 @@ class LabelProfileVoter extends ExtendedVoter
|
|||
'revert_element' => 'revert_element',
|
||||
];
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
protected function voteOnUser($attribute, $subject, User $user): bool
|
||||
{
|
||||
return $this->resolver->inherit($user, 'labels', self::MAPPING[$attribute]) ?? false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
protected function supports($attribute, $subject)
|
||||
{
|
||||
if ($subject instanceof LabelProfile) {
|
||||
if (!isset(self::MAPPING[$attribute])) {
|
||||
if (! isset(self::MAPPING[$attribute])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -59,4 +54,4 @@ class LabelProfileVoter extends ExtendedVoter
|
|||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,7 +28,9 @@ use App\Entity\UserSystem\User;
|
|||
|
||||
class OrderdetailVoter extends ExtendedVoter
|
||||
{
|
||||
/** @var string[] When this permsission are encountered, they are checked on part */
|
||||
/**
|
||||
* @var string[] When this permsission are encountered, they are checked on part
|
||||
*/
|
||||
protected const PART_PERMS = ['show_history', 'revert_element'];
|
||||
|
||||
protected function voteOnUser($attribute, $subject, User $user): bool
|
||||
|
|
|
@ -28,7 +28,9 @@ use App\Entity\UserSystem\User;
|
|||
|
||||
class PartLotVoter extends ExtendedVoter
|
||||
{
|
||||
/** @var string[] When this permsission are encountered, they are checked on part */
|
||||
/**
|
||||
* @var string[] When this permsission are encountered, they are checked on part
|
||||
*/
|
||||
protected const PART_PERMS = ['show_history', 'revert_element'];
|
||||
|
||||
protected function voteOnUser($attribute, $subject, User $user): bool
|
||||
|
|
|
@ -28,7 +28,9 @@ use App\Entity\UserSystem\User;
|
|||
|
||||
class PricedetailVoter extends ExtendedVoter
|
||||
{
|
||||
/** @var string[] When this permsission are encountered, they are checked on part */
|
||||
/**
|
||||
* @var string[] When this permsission are encountered, they are checked on part
|
||||
*/
|
||||
protected const PART_PERMS = ['show_history', 'revert_element'];
|
||||
|
||||
protected function voteOnUser($attribute, $subject, User $user): bool
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue