You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I like the idea of voters, but the problem is that they only work for the currently logged in user. I would like to perform access checks on behalf of other users.
Take the standard blog website as an example. Users have access to posts. But suppose I want to share a post with other users. I want to know whether Alice can view the post, to see if I can share it with her.
So instead of writing
if ($this->isGranted('view', $post)) { ... }
I want to write
if ($this->isGranted('view', $post, $user)) { ... }
Another use case would be for command line processes. For example, Bob requests to run a report that takes a long time. I have a command that runs in the background, and I want it to verify that Bob has access to the report he is requesting. I can't do that right now with voters.
Example
No response
The text was updated successfully, but these errors were encountered:
Description
I like the idea of voters, but the problem is that they only work for the currently logged in user. I would like to perform access checks on behalf of other users.
Take the standard blog website as an example. Users have access to posts. But suppose I want to share a post with other users. I want to know whether Alice can view the post, to see if I can share it with her.
So instead of writing
I want to write
Another use case would be for command line processes. For example, Bob requests to run a report that takes a long time. I have a command that runs in the background, and I want it to verify that Bob has access to the report he is requesting. I can't do that right now with voters.
Example
No response
The text was updated successfully, but these errors were encountered: