Compare commits

...

8 commits

Author SHA1 Message Date
Simon Vieille 79d549254f Merge branch 'develop'
All checks were successful
ci/woodpecker/push/woodpecker/2 Pipeline was successful
ci/woodpecker/push/woodpecker/1 Pipeline was successful
2024-03-25 16:00:53 +01:00
Simon Vieille c79e96e291
apply consensus as access decision manager strategy
All checks were successful
ci/woodpecker/push/woodpecker/2 Pipeline was successful
ci/woodpecker/push/woodpecker/1 Pipeline was successful
2024-03-25 16:00:51 +01:00
Simon Vieille 092b490ae2 Merge branch 'develop'
Some checks failed
ci/woodpecker/push/woodpecker/1 Pipeline failed
ci/woodpecker/push/woodpecker/2 Pipeline was successful
2024-03-25 15:46:57 +01:00
Simon Vieille fcecf74f90
add default voter
Some checks failed
ci/woodpecker/push/woodpecker/2 Pipeline failed
ci/woodpecker/push/woodpecker/1 Pipeline failed
2024-03-25 15:46:53 +01:00
Simon Vieille c00723a246 Merge branch 'develop'
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
ci/woodpecker/tag/woodpecker Pipeline failed
ci/woodpecker/push/woodpecker/2 Pipeline was successful
ci/woodpecker/push/woodpecker/1 Pipeline was successful
2023-11-01 16:34:57 +01:00
Simon Vieille e81b11c5ec
release v1.23.0
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2023-11-01 16:34:54 +01:00
Simon Vieille af2212ac8c Merge branch 'develop'
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2023-11-01 16:33:49 +01:00
Simon Vieille b57b0e3770
update murph
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2023-11-01 16:33:44 +01:00
4 changed files with 66 additions and 7 deletions

View file

@ -1,6 +1,10 @@
## [Unreleased]
## [v1.22.0] 2023-09-28
## [v1.23.0] - 2023-09-28
### Changed
* upgrade murph/murph-core
## [v1.22.0] - 2023-09-28
### Added
* update woodpecker ci base file
### Fixed
@ -8,11 +12,11 @@
### Changed
* upgrade murph/murph-core
## [1.21.0] 2023-08-11
## [1.21.0] - 2023-08-11
### Changed
* upgrade murph/murph-core
## [1.20.0] 2023-07-27
## [1.20.0] - 2023-07-27
### Fixed
* fix collection widget: allow_add/allow_delete and prototype
### Added
@ -21,11 +25,11 @@
### Changed
* upgrade murph/murph-core
## [1.19.0] 2023-04-15
## [1.19.0] - 2023-04-15
### Changed
* upgrade murph/murph-core
## [1.18.0] 2023-01-13
## [1.18.0] - 2023-01-13
### Added
* feat(dep): update dependencies
* feat(update): apply new recipe for phpunit
@ -53,7 +57,7 @@
* fix(config): fix firewall config
## [1.17.0] 2022-11-19
## [1.17.0] - 2022-11-19
### Changed
* upgrade murph/murph-core
* replace annotation with attributes

View file

@ -7,7 +7,7 @@
"prefer-stable": true,
"require": {
"php": ">=8.0.0",
"murph/murph-core": "^1.20"
"murph/murph-core": "^1.23"
},
"require-dev": {
"symfony/browser-kit": "^5.4",

View file

@ -3,6 +3,10 @@ security:
App\Entity\User:
algorithm: auto
access_decision_manager:
strategy: consensus
allow_if_all_abstain: false
# https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers
enable_authenticator_manager: true
# https://symfony.com/doc/current/security.html#registering-the-user-hashing-passwords

View file

@ -0,0 +1,51 @@
<?php
namespace App\Security\Voter;
use App\Core\Entity\EntityInterface;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Authorization\Voter\Voter;
use Symfony\Component\Security\Core\User\UserInterface;
class EntityVoter extends Voter
{
public const EDIT = 'edit';
public const VIEW = 'show';
public const DELETE = 'delete';
protected function supports(string $attribute, mixed $subject): bool
{
// replace with your own logic
// https://symfony.com/doc/current/security/voters.html
return in_array($attribute, [self::EDIT, self::VIEW, self::DELETE])
&& $subject instanceof EntityInterface;
}
protected function voteOnAttribute(string $attribute, mixed $subject, TokenInterface $token): bool
{
$user = $token->getUser();
if (!$user instanceof UserInterface) {
return false;
}
switch ($attribute) {
case self::EDIT:
return true;
break;
case self::VIEW:
return true;
break;
case self::DELETE:
return true;
break;
}
return false;
}
}