Skip to content

AO3-7189 Allow admins to change user skin via the Preferences page#5771

Open
Bilka2 wants to merge 1 commit intootwcode:masterfrom
Bilka2:AO3-7189-admins-change-user-skin
Open

AO3-7189 Allow admins to change user skin via the Preferences page#5771
Bilka2 wants to merge 1 commit intootwcode:masterfrom
Bilka2:AO3-7189-admins-change-user-skin

Conversation

@Bilka2
Copy link
Copy Markdown
Contributor

@Bilka2 Bilka2 commented Apr 29, 2026

Issue

https://otwarchive.atlassian.net/browse/AO3-7189

Purpose

Allow support and superadmins to edit a user's skin via their preferences.

Credit

Bilka

@available_locales = Locale.where(email_enabled: true)

@user.preference.attributes = preference_params
@user.preference.attributes = permitted_attributes(@preference)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

With this change, we're moving the parameter list for regular users into a Pundit policy class. We do this in one other place in the code base, PseudPolicy.

I'm surprised this isn't more common, but it makes sense because so far we either deal with objects that are only editable by admins (like admin settings) or have separate controllers to edit user data (users, user creations).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, it's based on https://github.com/varvet/pundit/tree/v2.3.1#strong-parameters. In the current version of pundit the method names have slightly changed but the general idea of having the parameters in the policy is the same

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants