We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7e7020d commit 15da864Copy full SHA for 15da864
cookbook/security/voters_data_permission.rst
@@ -118,6 +118,13 @@ edit a particular object. Here's an example implementation::
118
return VoterInterface::ACCESS_DENIED;
119
}
120
121
+ // double-check that our User object is the entity we expect.
122
+ // It always will be, unless we've configured our security system
123
+ // in some other way.
124
+ if (!$user instanceof User) {
125
+ throw new \LogicException('The user is somehow not our User class!');
126
+ }
127
+
128
switch($attribute) {
129
case self::VIEW:
130
// the data object could have for example a method isPrivate()
0 commit comments