PhoenixKitWeb.Live.Users.Libraries (phoenix_kit v2.41.0)

Copy Markdown View Source

A user's storage libraries (V203): /admin/libraries lists the ones they own or are a member of, and /admin/libraries/<slug or uuid> browses one with PhoenixKitWeb.Components.MediaBrowser.

Gated by the "storage" permission, and only while user libraries are on (Storage.Libraries.may_use_libraries?/1). A library is named in the URL by its slug when it is the viewer's own and by its uuid when it is shared with them (Libraries.url_id/2). A viewer gets the browser read-only. Creating, renaming, members and the default library are managed on the profile's Media tab (/profile/settings/media).

Owner and Admin

An Owner or Admin sees every other user's libraries on /admin/libraries too, below their own (metadata only: owner, files, size), and can open one by its uuid. Every such opening is written to the audit log ("storage.library_opened": who, which library, when, the IP address and the user agent). The "storage" permission alone never opens someone else's library.

Summary

Functions

handle_event(binary, arg2, socket)

Callback implementation for Phoenix.LiveView.handle_event/3.

handle_info(msg, socket)

Callback implementation for Phoenix.LiveView.handle_info/2.

handle_params(params, uri, socket)

Callback implementation for Phoenix.LiveView.handle_params/3.

mount(params, session, socket)

Callback implementation for Phoenix.LiveView.mount/3.

render(assigns)

Callback implementation for Phoenix.LiveView.render/1.