public function getPermissions()
    {
        if (!$this->permissions) {
            $perms = new Permissions();
            if ($this->user instanceof UserInterface) {
                $perms->grant($this->user, PermissionsInterface::PERMISSION_ALL);
            }
            $this->setPermissions($perms);
        }
        return $this->permissions;
    }