Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Role Voter for closed user groups #64

@dbu

Description

@dbu

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;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions