mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-06 07:19:37 +00:00
Compare commits
3 commits
919bf49ec1
...
a9d0caad5f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a9d0caad5f | ||
|
|
6ed4ad4c8c | ||
|
|
71946afd75 |
8 changed files with 860 additions and 811 deletions
38
composer.lock
generated
38
composer.lock
generated
|
|
@ -5000,16 +5000,16 @@
|
|||
},
|
||||
{
|
||||
"name": "jbtronics/settings-bundle",
|
||||
"version": "v3.0.1",
|
||||
"version": "v3.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/jbtronics/settings-bundle.git",
|
||||
"reference": "9103bd7f78f0b223d1c7167feb824004fc2a9f07"
|
||||
"reference": "7f19bac5a66533c6974948a484871087301b2a2e"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/jbtronics/settings-bundle/zipball/9103bd7f78f0b223d1c7167feb824004fc2a9f07",
|
||||
"reference": "9103bd7f78f0b223d1c7167feb824004fc2a9f07",
|
||||
"url": "https://api.github.com/repos/jbtronics/settings-bundle/zipball/7f19bac5a66533c6974948a484871087301b2a2e",
|
||||
"reference": "7f19bac5a66533c6974948a484871087301b2a2e",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
|
@ -5070,7 +5070,7 @@
|
|||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/jbtronics/settings-bundle/issues",
|
||||
"source": "https://github.com/jbtronics/settings-bundle/tree/v3.0.1"
|
||||
"source": "https://github.com/jbtronics/settings-bundle/tree/v3.1.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
|
@ -5082,7 +5082,7 @@
|
|||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2025-08-24T21:20:15+00:00"
|
||||
"time": "2025-09-19T06:54:58+00:00"
|
||||
},
|
||||
{
|
||||
"name": "jfcherng/php-color-output",
|
||||
|
|
@ -20473,16 +20473,16 @@
|
|||
},
|
||||
{
|
||||
"name": "sebastian/exporter",
|
||||
"version": "6.3.0",
|
||||
"version": "6.3.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/exporter.git",
|
||||
"reference": "3473f61172093b2da7de1fb5782e1f24cc036dc3"
|
||||
"reference": "8f67e53d3fcaf53105f95cc14f1630493d0fa2e6"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/3473f61172093b2da7de1fb5782e1f24cc036dc3",
|
||||
"reference": "3473f61172093b2da7de1fb5782e1f24cc036dc3",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/8f67e53d3fcaf53105f95cc14f1630493d0fa2e6",
|
||||
"reference": "8f67e53d3fcaf53105f95cc14f1630493d0fa2e6",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
|
@ -20496,7 +20496,7 @@
|
|||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "6.1-dev"
|
||||
"dev-main": "6.3-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
|
|
@ -20539,15 +20539,27 @@
|
|||
"support": {
|
||||
"issues": "https://github.com/sebastianbergmann/exporter/issues",
|
||||
"security": "https://github.com/sebastianbergmann/exporter/security/policy",
|
||||
"source": "https://github.com/sebastianbergmann/exporter/tree/6.3.0"
|
||||
"source": "https://github.com/sebastianbergmann/exporter/tree/6.3.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/sebastianbergmann",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://liberapay.com/sebastianbergmann",
|
||||
"type": "liberapay"
|
||||
},
|
||||
{
|
||||
"url": "https://thanks.dev/u/gh/sebastianbergmann",
|
||||
"type": "thanks_dev"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/sebastian/exporter",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2024-12-05T09:17:50+00:00"
|
||||
"time": "2025-09-22T05:34:00+00:00"
|
||||
},
|
||||
{
|
||||
"name": "sebastian/global-state",
|
||||
|
|
|
|||
33
config/packages/doctrine.php
Normal file
33
config/packages/doctrine.php
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
/*
|
||||
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
|
||||
*
|
||||
* Copyright (C) 2019 - 2025 Jan Böhmer (https://github.com/jbtronics)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published
|
||||
* by the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* This class extends the default doctrine ORM configuration to enable native lazy objects on PHP 8.4+.
|
||||
* We have to do this in a PHP file, because the yaml file does not support conditionals on PHP version.
|
||||
*/
|
||||
|
||||
return static function(\Symfony\Config\DoctrineConfig $doctrine) {
|
||||
//On PHP 8.4+ we can use native lazy objects, which are much more efficient than proxies.
|
||||
if (PHP_VERSION_ID >= 80400) {
|
||||
$doctrine->orm()->enableNativeLazyObjects(true);
|
||||
}
|
||||
};
|
||||
|
|
@ -38,7 +38,7 @@ class EnforceEventCommentTypesType extends AbstractType
|
|||
return EnumType::class;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'multiple' => true,
|
||||
|
|
@ -46,4 +46,4 @@ class EnforceEventCommentTypesType extends AbstractType
|
|||
'empty_data' => [],
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,10 +44,10 @@ class LocaleSelectType extends AbstractType
|
|||
return LocaleType::class;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'preferred_choices' => $this->preferred_languages,
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ declare(strict_types=1);
|
|||
namespace App\Security;
|
||||
|
||||
use App\Entity\UserSystem\User;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
|
||||
use Symfony\Component\Security\Core\Exception\AccountStatusException;
|
||||
use Symfony\Component\Security\Core\Exception\CustomUserMessageAccountStatusException;
|
||||
use Symfony\Component\Security\Core\User\UserCheckerInterface;
|
||||
|
|
@ -51,7 +52,7 @@ final class UserChecker implements UserCheckerInterface
|
|||
*
|
||||
* @throws AccountStatusException
|
||||
*/
|
||||
public function checkPostAuth(UserInterface $user): void
|
||||
public function checkPostAuth(UserInterface $user, ?TokenInterface $token = null): void
|
||||
{
|
||||
if (!$user instanceof User) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ use App\Entity\ProjectSystem\Project;
|
|||
use App\Entity\ProjectSystem\ProjectBOMEntry;
|
||||
use Symfony\Bundle\SecurityBundle\Security;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
|
||||
use Symfony\Component\Security\Core\Authorization\Voter\Vote;
|
||||
use Symfony\Component\Security\Core\Authorization\Voter\Voter;
|
||||
|
||||
/**
|
||||
|
|
@ -46,7 +47,7 @@ class BOMEntryVoter extends Voter
|
|||
return $this->supportsAttribute($attribute) && is_a($subject, ProjectBOMEntry::class, true);
|
||||
}
|
||||
|
||||
protected function voteOnAttribute(string $attribute, mixed $subject, TokenInterface $token): bool
|
||||
protected function voteOnAttribute(string $attribute, mixed $subject, TokenInterface $token, ?Vote $vote = null): bool
|
||||
{
|
||||
if (!is_a($subject, ProjectBOMEntry::class, true)) {
|
||||
return false;
|
||||
|
|
@ -87,4 +88,4 @@ class BOMEntryVoter extends Voter
|
|||
{
|
||||
return $subjectType === 'string' || is_a($subjectType, ProjectBOMEntry::class, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ namespace App\Security\Voter;
|
|||
use App\Services\UserSystem\PermissionManager;
|
||||
use App\Services\UserSystem\VoterHelper;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
|
||||
use Symfony\Component\Security\Core\Authorization\Voter\Vote;
|
||||
use Symfony\Component\Security\Core\Authorization\Voter\Voter;
|
||||
|
||||
/**
|
||||
|
|
@ -41,7 +42,7 @@ final class HasAccessPermissionsVoter extends Voter
|
|||
{
|
||||
}
|
||||
|
||||
protected function voteOnAttribute(string $attribute, $subject, TokenInterface $token): bool
|
||||
protected function voteOnAttribute(string $attribute, $subject, TokenInterface $token, ?Vote $vote = null): bool
|
||||
{
|
||||
$user = $this->helper->resolveUser($token);
|
||||
return $this->permissionManager->hasAnyPermissionSetToAllowInherited($user);
|
||||
|
|
@ -56,4 +57,4 @@ final class HasAccessPermissionsVoter extends Voter
|
|||
{
|
||||
return $attribute === self::ROLE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue