API / Minn\Admin / PreferencesController

PreferencesController final readonly class

Minn\Admin\PreferencesController · public/minn/src/Minn/Admin/PreferencesController.php · 115 lines

A person's own settings in minn-admin/v1: their appearance, the views they hid, and an administrator's reach into another person's, for the user edit page.

Used by 1

Constants and properties

privatereadonly Minn\Admin\Appearance $appearance

Promoted from the constructor.

privatereadonly Minn\Admin\HiddenIntegrations $hiddenIntegrations

Promoted from the constructor.

privatereadonly Minn\Rest\Caller $caller

Promoted from the constructor.

Public

new__construct(Minn\Admin\Appearance $appearance, Minn\Admin\HiddenIntegrations $hiddenIntegrations, Minn\Rest\Caller $caller)#
methodmyAppearance(Minn\Http\Request $request): Minn\Http\ResponseGET /minn-admin/v1/me/appearance (floor edit_posts)#

The caller's appearance.

methodsaveMyAppearance(Minn\Http\Request $request): Minn\Http\ResponsePOST /minn-admin/v1/me/appearance (floor edit_posts)#

Saves the caller's appearance.

methoduserAppearance(Minn\Http\Request $request, string $id): Minn\Http\ResponseGET /minn-admin/v1/users/{id:\d+}/appearance (cap edit_user on {id})#

A user's appearance, for one who may edit them.

methodsaveUserAppearance(Minn\Http\Request $request, string $id): Minn\Http\ResponsePOST /minn-admin/v1/users/{id:\d+}/appearance (cap edit_user on {id})#

Saves a user's appearance.

methodhidden(Minn\Http\Request $request, string $id): Minn\Http\ResponseGET /minn-admin/v1/users/{id:\d+}/hidden (cap edit_user on {id})#

The target user's restore list, for the user edit page.

methodunhideForUser(Minn\Http\Request $request, string $id): Minn\Http\ResponsePOST /minn-admin/v1/users/{id:\d+}/integrations/unhide (cap edit_user on {id})#

An administrator restores something another person hid; hiding stays that person's own choice.

methodhide(Minn\Http\Request $request): Minn\Http\ResponsePOST /minn-admin/v1/integrations/hide (floor edit_posts)#

Hides a view for the caller.

methodunhide(Minn\Http\Request $request): Minn\Http\ResponsePOST /minn-admin/v1/integrations/unhide (floor edit_posts)#

Shows a view again for the caller.

Internals 4

Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.

privateintegrationId(Minn\Http\Request $request): string#
privateintegrationState(int $userId): array#

The boot slices a hide or unhide repaints from. The engine registers no plugin surfaces, editor panels, design sources, or block forms.

privateappearanceBody(Minn\Http\Request $request): array#
privateeditableUser(string $id): int#