public function removePolicy(APIRole $role, APIPolicy $policy)
    {
        $values = $this->requestParser->parse('role', $role->id);
        $response = $this->client->request(
            'DELETE',
            $this->requestParser->generate(
                'policy',
                array(
                    'role' => $values['role'],
                    'policy' => $policy->id,
                )
            ),
            new Message(
                // @todo: What media-type should we set here? Actually, it should be
                // all expected exceptions + none? Or is "Section" correct,
                // since this is what is to be expected by the resource
                // identified by the URL?
                array('Accept' => $this->outputVisitor->getMediaType('Policy'))
            )
        );

        if (!empty($response->body)) {
            $this->inputDispatcher->parse($response);
        }

        return $this->loadRole($role->id);
    }
public function removePolicy(APIRole $role, APIPolicy $policy)
    {
        $values = $this->requestParser->parse('role', $role->id);
        $response = $this->client->request(
            'DELETE',
            $this->requestParser->generate(
                'policy',
                array(
                    'role' => $values['role'],
                    'policy' => $policy->id,
                )
            ),
            new Message(
                // @todo: What media-type should we set here? Actually, it should be
                // all expected exceptions + none? Or is "Section" correct,
                // since this is what is to be expected by the resource
                // identified by the URL?
                array('Accept' => $this->outputVisitor->getMediaType('Policy'))
            )
        );

        if (!empty($response->body)) {
            $this->inputDispatcher->parse($response);
        }

        return $this->loadRole($role->id);
    }
public function removePolicy ( APIRole $ role , APIPolicy $ policy ) { $ values = $ this -> requestParser -> parse ( 'role' , $ role -> id ) ; $ response = $ this -> client -> request ( 'DELETE' , $ this -> requestParser -> generate ( 'policy' , array ( 'role' => $ values [ 'role' ] , 'policy' => $ policy -> id , ) ) , new Message ( // @todo: What media-type should we set here? Actually, it should be // all expected exceptions + none? Or is "Section" correct, // since this is what is to be expected by the resource // identified by the URL? array ( 'Accept' => $ this -> outputVisitor -> getMediaType ( 'Policy' ) ) ) ) ; if ( ! empty ( $ response -> body ) ) { $ this -> inputDispatcher -> parse ( $ response ) ; } return $ this -> loadRole ( $ role -> id ) ; }
Removes a policy from the role.

@deprecated since 5.3, use {@link removePolicyByRoleDraft()} instead.

@throws \eZ\Publish\API\Repository\Exceptions\UnauthorizedException if the authenticated user is not allowed to remove a policy
@throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException if policy does not belong to the given role

@param \eZ\Publish\API\Repository\Values\User\Role $role
@param \eZ\Publish\API\Repository\Values\User\Policy $policy the policy to remove from the role

@return \eZ\Publish\API\Repository\Values\User\Role the updated role
Removes a policy from the role .