public function setPermissions(PermissionsInterface $permissions)
    {
        // Assure the user has always all rights.
        if ($this->user) {
            $permissions->grant($this->user, Permissions::PERMISSION_ALL);
        }
        $this->permissions = $permissions;

        return $this;
    }