-
-
Notifications
You must be signed in to change notification settings - Fork 530
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
Wire up Preferences #86
Comments
Jason mentioned something for future discussion. If we have default preferences for user groups, how might we handle users who are part of multiple groups? |
Putting aside the UI for setting your preferences, this is how I think it should work: The title: John Smith
email: john@smith.com
preferences:
active_site: english
columns:
collection_blog:
- title
- slug That translates pretty well to other user stores. DB could have a Basically Then we can retrieve a preference with a fallback, again, just like config. Statamic\API\Preference::get('active_site', 'fallback'); Don't get fancy with the fallback - don't try to automatically look in the config. If we want to fallback to a config, we can pass one in. Preference::get('locale', config('statamic.cp.locale')); Then there should be a way to set them. Preference::set('locale', 'en');
// which might do something like...
$user->preferences($updatedPreferences)->save(); Eventually, for setting preferences, I think we could make a form that just has a bunch of fields, then do |
This sounds solid.
|
What if the user inherited from the first group in their groups array? Then in UX we could potentially allow them to drag group order, and message that the user will inherit group preferences from the first attached group with preferences? |
That makes sense - and then we just array merge them from bottom to top. OR, we give them an "additive" or "subtractive" mode, where we can loop through each permission and override it one way or the other depending on how they should stack? |
I like! Yeah additive, if we loop through groups from bottom up (least important to most important group), setting/overriding preferences in that order, and then finally set/override from the user yaml, precedence should work itself out 👍 |
Let’s just do middle out.
|
Preferences are settings that you manage in the control panel. There should be defaults that you can override on a per-user (or user group?) level.
The text was updated successfully, but these errors were encountered: