Browse Source

Passing the current object to the voters

As for ACL security handler, shouldn't the current object be passed to the voters ?
Pierre de LESPINAY 12 years ago
parent
commit
d9f9f24048
1 changed files with 2 additions and 1 deletions
  1. 2 1
      Security/Handler/RoleSecurityHandler.php

+ 2 - 1
Security/Handler/RoleSecurityHandler.php

@@ -45,7 +45,8 @@ class RoleSecurityHandler implements SecurityHandlerInterface
         }
 
         try {
-            return $this->securityContext->isGranted($this->superAdminRoles) || $this->securityContext->isGranted($attributes);
+            return $this->securityContext->isGranted($this->superAdminRoles)
+                || $this->securityContext->isGranted($attributes, $object);
         } catch (AuthenticationCredentialsNotFoundException $e) {
             return false;
         } catch (\Exception $e) {