Explorar el Código

Merge pull request #1507 from Glideh/patch-1

RoleSecurityHandler - Passing the current object to voters
Thomas hace 11 años
padre
commit
d5eb607338
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      Security/Handler/RoleSecurityHandler.php

+ 2 - 1
Security/Handler/RoleSecurityHandler.php

@@ -45,7 +45,8 @@ class RoleSecurityHandler implements SecurityHandlerInterface
         }
         }
 
 
         try {
         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) {
         } catch (AuthenticationCredentialsNotFoundException $e) {
             return false;
             return false;
         } catch (\Exception $e) {
         } catch (\Exception $e) {