class ApiVoter extends Voter

Voter for Api access

Constants

API_USER_ADD_ROLE

Used for access to api add-role

API_USER_AUTHENTICATE

Used for access to api authenticate

API_USER_CHANGE_PASSWORD

Used for access to api change password

API_USER_CREATE

Used for access to api create

API_USER_DELETE

Used for access to api delete

API_USER_DELETE_ROLE

Used for access to api delete-role

API_USER_DISPLAY

Used for access to api display

API_USER_EXPORT

Used for access to api export

API_USER_LIST

Used for access to api list

API_USER_MODIFY

Used for access to api modify

API_USER_MODIFY_ROLE

Used for access to api create

API_USER_RESET_PASSWORD

Used for access to reset password

API_USER_SEARCH

Used for access to api search

ATTRIBUTES

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

Properties

private ConfigServiceInterface $configService Stores ConfigServiceInterface
private AccessDecisionManagerInterface $decisionManager Stores AccessDecisionManagerInterface
private Request $request Stores curent Request

Methods

__construct(ConfigServiceInterface $configService, AccessDecisionManagerInterface $decisionManager, RequestStack $requestStack)

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
isApiEnabled()

Checks if API is enabled

bool
isApiKeyValid($subject)

Checks if API is valid

bool
isOwner($token, $subject)

Checks if user is owner or has admin rights

bool
isSignupAllowed()

Checks if signup is allowed

Details

at line 144
__construct(ConfigServiceInterface $configService, AccessDecisionManagerInterface $decisionManager, RequestStack $requestStack)

Parameters

ConfigServiceInterface $configService
AccessDecisionManagerInterface $decisionManager
RequestStack $requestStack

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

Checks if attribute and subject are supported

Parameters

$attribute
$subject

Return Value

bool

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

Votes if access is granted

Parameters

$attribute
$subject
TokenInterface $token

Return Value

bool

Exceptions

LogicException

at line 212
private bool isAllowed($token)

Checks if user has sufficient rights

Parameters

$token

Return Value

bool

at line 221
private bool isApiEnabled()

Checks if API is enabled

Return Value

bool

at line 230
private bool isApiKeyValid($subject)

Checks if API is valid

Parameters

$subject

Return Value

bool

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

Checks if user is owner or has admin rights

Parameters

$token
$subject

Return Value

bool

at line 248
private bool isSignupAllowed()

Checks if signup is allowed

Return Value

bool