core-bundle icon indicating copy to clipboard operation
core-bundle copied to clipboard

Role Voter for closed user groups

Open dbu opened this issue 12 years ago • 0 comments

this is somewhat similar to the state voter, but would be more explicit and straightforward to configure (or maybe its just some syntactic sugar around the state voter).

    RoleAccessVoter
    $role = $object->getRole();
    if (!$role) {
        return self::ACCESS_ABSTAIN;
    }
    return $context->isGranted($role) ? self::ACCESS_GRANTED :  self::ACCESS_DENIED;

dbu avatar Jun 25 '13 15:06 dbu