Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Handle case where user lacking some setting caps loads a snapshot into the Customizer #58

Closed
westonruter opened this issue Jul 8, 2016 · 4 comments
Labels

Comments

@westonruter
Copy link
Contributor

If a snapshot is saved that contains modified settings that require edit_theme_options and yet a user opens this snapshot in the Customizer and they lack this capability, the setting will effectively get dropped from the snapshot if they try saving. I see two options here:

  • Block a user from being able to load a snapshot when they lack all caps for the settings in it.
  • When a user with insufficient caps saves settings that are coming from a snapshot, ensure that all settings from the snapshot get loaded and forcibly saved along with the settings the user actually submitted in the request.

The first option would be easier and would be more expected.

@westonruter
Copy link
Contributor Author

This should be addressed by changesets. A changeset UUID is always supplied when accessing the preview and all pre-saved settings in the changeset should be made available in the preview, even though the user cannot modify them (write them into the changeset).

@jeffpaul
Copy link

@westonruter So this should be resolved via #102?

@westonruter
Copy link
Contributor Author

@jeffpaul I believe so. Just needs testing to confirm.

@PatelUtkarsh
Copy link
Member

@westonruter Tested and it works as expected. The user can load changeset and make changes to the section which is accessible to it, other section data preserve on save of that.

Created snapshot with a user A who doesn't have access to some section and added some data, Added new data in changeset with User B(admin) of which user A doesn't have access to, Opened changeset with user A and edited/updated new data, It preserves user B's changes in changeset.
CC: @jeffpaul.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants