Explorar o código

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 %!s(int64=12) %!d(string=hai) anos
pai
achega
d9f9f24048
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  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) {