diff --git a/Resources/config/services.yml b/Resources/config/services.yml index 4d8b4b625..326990d35 100644 --- a/Resources/config/services.yml +++ b/Resources/config/services.yml @@ -30,6 +30,7 @@ services: - "@chill.main.security.authorization.helper" tags: - { name: security.voter } + - { name: chill.role } chill.report.form.report_type: class: Chill\ReportBundle\Form\ReportType diff --git a/Security/Authorization/ReportVoter.php b/Security/Authorization/ReportVoter.php index e363923df..e3218fec7 100644 --- a/Security/Authorization/ReportVoter.php +++ b/Security/Authorization/ReportVoter.php @@ -21,13 +21,14 @@ namespace Chill\ReportBundle\Security\Authorization; use Chill\MainBundle\Security\Authorization\AbstractChillVoter; use Chill\MainBundle\Security\Authorization\AuthorizationHelper; +use Chill\MainBundle\Security\ProvideRoleInterface; /** * * * @author Julien Fastré */ -class ReportVoter extends AbstractChillVoter +class ReportVoter extends AbstractChillVoter implements ProvideRoleInterface { const CREATE = 'CHILL_REPORT_CREATE'; const SEE = 'CHILL_REPORT_SEE'; @@ -63,4 +64,15 @@ class ReportVoter extends AbstractChillVoter return $this->helper->userHasAccess($user, $report, $attribute); } + + public function getRoles() + { + return $this->getSupportedAttributes(); + } + + public function getRolesWithoutScope() + { + return array(); + } + } diff --git a/composer.json b/composer.json index 197bef509..38e26d831 100644 --- a/composer.json +++ b/composer.json @@ -25,9 +25,9 @@ "doctrine/orm": "~2.4", "doctrine/common": "~2.4", "doctrine/doctrine-bundle": "~1.2", - "chill-project/main": "dev-master@dev", + "chill-project/main": "dev-master", "chill-project/custom-fields": "dev-master@dev", - "chill-project/person": "dev-master@dev", + "chill-project/person": "dev-master", "champs-libres/composer-bundle-migration": "~1.0", "doctrine/doctrine-migrations-bundle": "dev-master@dev", "doctrine/migrations": "~1.0@dev"