Skip to content

fix(settings): save the guest allowlist again and add a default quota selector#1602

Open
ernolf wants to merge 1 commit into
mainfrom
ernolf/fix/allowlist-save-and-default-quota
Open

fix(settings): save the guest allowlist again and add a default quota selector#1602
ernolf wants to merge 1 commit into
mainfrom
ernolf/fix/allowlist-save-and-default-quota

Conversation

@ernolf

@ernolf ernolf commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Two changes to the Guests admin settings page (src/views/GuestSettings.vue and the config plumbing behind it):

  1. Fix: changing the guest app allowlist is now persisted again.
  2. Feature: a default quota for new guest accounts can now be set from the Guests tab.

1. Fix: allowlist changes are not saved

Fixes #1591. (This is also the allowlist-selector remainder of #995, which was closed after #1598 — but #1598 only fixed the on/off switches; the allowlist NcSelect itself still used @input="saveConfig", which @nextcloud/vue 9 no longer emits, the same Vue 3 migration regression as #1323.) So editing the list of allowed apps sent no PUT /apps/guests/config and was lost on reload.

The selector is reworked to match the inline-edit pattern used in the Accounts management:

  • The current allowlist is shown read-only as wrapping chips (the full list stays visible, no truncation) with an edit (pencil) button, indented under the "Limit guest access to an app's allowlist" switch it belongs to.
  • Clicking the pencil opens the NcSelect; edits go to a draft. A confirm (check) button applies the draft and saves. Closing the dropdown no longer saves on its own, and the save no longer relies on the dead @input event.
  • The reset button keeps working and now also refreshes the draft while editing.

2. Feature: default quota for new guest accounts

Adds a quota selector to the Guests tab, mirroring the Accounts quota field:

  • Options: Default (…), Unlimited, 1 GB / 5 GB / 10 GB, plus a typed custom value. Typing a number offers it with selectable units (e.g. 500500 KB / 500 MB / 500 GB); a unit is required so the stored value is unambiguous.
  • The Default option shows the actual preset-derived value (e.g. "Default (1 GB)"), read from the config lexicon via IAppConfig::getDetails(). Selecting it removes the override so the preset default applies again.

Backend: Config gains getGuestQuota(), hasGuestQuotaOverride(), getGuestQuotaDefault() and setGuestQuota(); SettingsController::getConfig() returns guestQuota (the default sentinel when no override is stored) and guestQuotaDefault, and setConfig() accepts and validates guestQuota (computerFileSize). The existing GuestManager already applies guest_quota on guest creation, so no behaviour change there.

Closes #1601


Testing

  • Allowlist: add/remove apps, confirm with the check button, reload — the selection persists. Toggling the switch and the reset button still work.
  • Quota: pick a preset / Unlimited / a typed size, reload — the value persists; "Default (…)" removes the override; a bare number without a unit is rejected.

Notes

  • The allowlist fix is also relevant to the 4.7 line (same as fix(settings): use @update:modelValue so admin switches save again #1598); a backport may be wanted.

  • New user-facing strings are added in the usual places for translation.

  • Also corrects three README links that still pointed to the removed master branch (now main).

  • The content of this PR was partly generated using AI

Screenshots:

image
image
image
image
image

… selector

- the allowlist NcSelect used @input, which @nextcloud/vue 9 no longer emits, so editing the allowed apps was never saved
- rework the allowlist into a read-only chip list with an edit (pencil) button and a confirm (check) button that applies and saves; editing uses a draft, so closing the dropdown no longer saves
- add a "Default quota for new guest accounts" selector (the preset-derived default shown with its value, Unlimited, common sizes, or a custom size with a required unit)
- add Config getters/setters and SettingsController plumbing for guest_quota, reading the preset default via IAppConfig::getDetails()
- cover the new quota config methods with unit tests
- document the default quota and its Quick presets source in the README
- fix three README links that still pointed to the removed `master` branch (now `main`)

Signed-off-by: ernolf <raphael.gradenwitz@googlemail.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@ernolf ernolf requested a review from icewind1991 June 12, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow setting the default quota for new guest accounts from the Guests settings Can't modify guests app's allowlist

2 participants