Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restrict editing of system serving config attachments #1389

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

csutter
Copy link
Contributor

@csutter csutter commented Feb 21, 2025

Our serving configs have different use cases, one of which is system. These are internal serving configs that we want don't want users to be able to attach controls or otherwise edit.

This adds a scope and predicate for the concept of user_editable serving configs, restricts the ControlAttachmentsController to only allow edit/update for editable serving configs, and removes the "Manage attached controls" link for those that aren't.

This makes it more obvious what's gone when generating several objects
from the same factory, and avoids collisions on unique fields.
This adds a new scope (`.user_editable`) and corresponding predicate
method (`#user_editable?`) to `ServingConfig` to define whether a
serving config is "user editable".

Users can edit `live` or `preview` serving configs, but not `system`
ones (which can only be modified programatically, for example by
Search Admin scripts). They're still viewable in the UI though.
This scopes the `ControlAttachmentsController` to only allow editing of
control attachments for serving configs that are user editable, and
removes the edit link from the show pages of those that aren't.
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.

1 participant