Commit 6b3b1768 authored by Julien Fastré's avatar Julien Fastré
Browse files

Merge add_ui_permission into master

+ set deps to chill-project/main dev-master

Squashed commit of the following:

commit c120c934
Author: Julien Fastré <julien.fastre@champs-libres.coop>
Date:   Mon Sep 14 00:50:50 2015 +0200

    switch to role declaration in code

commit 7fba3535
Author: Julien Fastré <julien.fastre@champs-libres.coop>
Date:   Mon Aug 31 23:57:59 2015 +0200

    declare role in chill.available_roles parameter
parent f301dbdd
......@@ -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
......
......@@ -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é <julien.fastre@champs-libres.coop>
*/
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();
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment