mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-27 09:05:01 +00:00
Refactorize StoredObjectVoter.php
The StoredObjectVoter.php has been refactorized to handle context-specific voters.\ This way we can check if the context-specific voter should handle the authorization or not.\ If not, there is a simple fallback to check on the USER_ROLE.
This commit is contained in:
14
src/Bundle/ChillDocStoreBundle/config/services/voter.yaml
Normal file
14
src/Bundle/ChillDocStoreBundle/config/services/voter.yaml
Normal file
@@ -0,0 +1,14 @@
|
||||
services:
|
||||
_defaults:
|
||||
autowire: true
|
||||
autoconfigure: true
|
||||
Chill\DocStoreBundle\Security\Authorization\StoredObjectVoter:
|
||||
arguments:
|
||||
$storedObjectVoters:
|
||||
# context specific voters
|
||||
- '@accompanying_course_document_voter'
|
||||
tags:
|
||||
- { name: security.voter }
|
||||
|
||||
accompanying_course_document_voter:
|
||||
class: Chill\DocStoreBundle\Security\Authorization\AccompanyingCourseDocumentVoter
|
Reference in New Issue
Block a user