Browse Source

Merge pull request #1507 from Glideh/patch-1

RoleSecurityHandler - Passing the current object to voters
Thomas 11 years ago
parent
commit
d5eb607338
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) {