Questions tagged [symfony4-voter]
20 questions
0
votes
2 answers
Handle multi level of roles
I have a multi applications which works with authenticated users.
All these applications can be deployed together for differents clients but with the same user database.
For example a chain of hotels.
User's roles informations are available in a…

Lerminou
- 189
- 1
- 9
0
votes
1 answer
Symfony Voters only for checking user permission?
Symfony Voters (Documentation) is for checking user permission for an entity (usually) :
Security voters are the most granular way of checking permissions (e.g. "can this specific user edit the given item?")
Sut if I want to control the…

Gaylord.P
- 1,539
- 2
- 24
- 54
0
votes
1 answer
How to use Symfony 4 Voters without denying access to a controller
I’m using symfony 4 voters and love how it works to grant or deny permission to a controller method.
What I’m trying to achieve now is to check if user has permission to see a specific block in my twig view. I have a voter called Web:
I’d like to do…

Miles M.
- 4,089
- 12
- 62
- 108
0
votes
0 answers
Symfony Voters: Access Denied
Is it normal when supports() returns false, it results Access Denied? According the Doc, Voter should end-up on supports so I assume an access should be granted.
Voter::supports($attribute, $subject)
When isGranted() (or denyAccessUnlessGranted())…

Roman Newaza
- 11,405
- 11
- 58
- 89
-2
votes
1 answer
Symfony 4: how to get voters who voted for granted?
How can I get voters who voted for "granted", inside event subscriber? Is there any service which I can fetch and use it?
My use case. My app has two voters: main voter and admin voter. I want to show additional flash message when access is…

Tomasz Gąsior
- 71
- 5