public function loadPolicy($roleId, $policyId, Request $request)
    {
        $loadedRole = $this->roleService->loadRole($roleId);
        foreach ($loadedRole->getPolicies() as $policy) {
            if ($policy->id == $policyId) {
                return $policy;
            }
        }

        throw new Exceptions\NotFoundException("Policy not found: '{$request->getPathInfo()}'.");
    }
public function loadPolicy($roleId, $policyId, Request $request)
    {
        $loadedRole = $this->roleService->loadRole($roleId);
        foreach ($loadedRole->getPolicies() as $policy) {
            if ($policy->id == $policyId) {
                return $policy;
            }
        }

        throw new Exceptions\NotFoundException("Policy not found: '{$request->getPathInfo()}'.");
    }
public function loadPolicy ( $ roleId , $ policyId , Request $ request ) { $ loadedRole = $ this -> roleService -> loadRole ( $ roleId ) ; foreach ( $ loadedRole -> getPolicies ( ) as $ policy ) { if ( $ policy -> id == $ policyId ) { return $ policy ; } } throw new Exceptions \ NotFoundException ( "Policy not found: '{$request->getPathInfo()}'." ) ; }
Loads a policy.

@param $roleId
@param $policyId

@throws \eZ\Publish\Core\REST\Common\Exceptions\NotFoundException

@return \eZ\Publish\API\Repository\Values\User\Policy
Loads a policy .