src/Entity/Permissions.php
public function revoke($resource, $permission = null, $build = true)
    {
        if (self::PERMISSION_NONE == $permission || !$this->isAssigned($resource)) {
            return $this;
        }
        
        if (self::PERMISSION_CHANGE == $permission) {
            return $this->grant($resource, self::PERMISSION_VIEW, $build);
        }
        
        return $this->grant($resource, self::PERMISSION_NONE, $build);
    }
public function revoke($resource, $permission = null, $build = true)
    {
        if (self::PERMISSION_NONE == $permission || !$this->isAssigned($resource)) {
            return $this;
        }
        
        if (self::PERMISSION_CHANGE == $permission) {
            return $this->grant($resource, self::PERMISSION_VIEW, $build);
        }
        
        return $this->grant($resource, self::PERMISSION_NONE, $build);
    }
Revokes a permission from a user or resource.

{@inheritDoc}

@param bool $build Should the view and change arrays be rebuild?

@return $this|PermissionsInterface