class UserVoter extends Voter

Voter for User access

Constants

CHANGE_PASSWORD

Used for access to change-password

DASHBOARD

Used for access to dashboard

DELETE

Used for access to delete

DISPLAY

Used for access to display

EXPORT

Used for access to export

HELP

Used for access to help

MODIFY

Used for access to modify

PUBLIC_PROFILE

Used for access to public-profile

RESET_PASSWORD

Used for access to reset-password

SIGNUP

Used for access to signup

SIGNUP_CONFIRM

Used for access to signup-confirm

ATTRIBUTES

Contains all the available attributes to check with in supports()

Properties

private ConfigServiceInterface $configService Stores ConfigServiceInterface
private AccessDecisionManagerInterface $decisionManager Stores AccessDecisionManagerInterface

Methods

__construct(ConfigServiceInterface $configService, AccessDecisionManagerInterface $decisionManager)

No description

bool
supports($attribute, $subject)

Checks if attribute and subject are supported

bool
voteOnAttribute($attribute, $subject, TokenInterface $token)

Votes if access is granted

bool
isAllowed($token)

Checks if user has sufficient rights

bool
isAllowedPublicProfile()

Checks if public profile is allowed by website

bool
isOwner($token, $subject)

Checks if user is owner or has sufficient rights

Details

at line 122
__construct(ConfigServiceInterface $configService, AccessDecisionManagerInterface $decisionManager)

Parameters

ConfigServiceInterface $configService
AccessDecisionManagerInterface $decisionManager

at line 135
protected bool supports($attribute, $subject)

Checks if attribute and subject are supported

Parameters

$attribute
$subject

Return Value

bool

at line 149
protected bool voteOnAttribute($attribute, $subject, TokenInterface $token)

Votes if access is granted

Parameters

$attribute
$subject
TokenInterface $token

Return Value

bool

Exceptions

LogicException

at line 185
private bool isAllowed($token)

Checks if user has sufficient rights

Parameters

$token

Return Value

bool

at line 194
bool isAllowedPublicProfile()

Checks if public profile is allowed by website

Return Value

bool

at line 203
private bool isOwner($token, $subject)

Checks if user is owner or has sufficient rights

Parameters

$token
$subject

Return Value

bool