소스 검색

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 년 전
부모
커밋
d9f9f24048
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  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) {