Libraries: separate file collections for the site and for users
Describes PhoenixKit 3.5.0.
A library is a separate collection of files with its own folders. Every site has one, Media. You can add more site libraries, each with its own storage profile and rendition profile, and you can let users keep libraries of their own.
Where to find it
Settings → Media, tab Libraries (/admin/settings/media?tab=libraries). You need the Manage storage permission, or the Owner or Admin role. The files themselves are browsed on the Media page, which gets a library switcher once there is more than one library you can open.
Settings → Media → Libraries.
Site libraries
The Libraries table lists each site library with its Name, Files, Size, Storage (its storage and rendition profile) and Sync (whether its files match those profiles). The default library is marked Default.
New library asks for a Library name and, when there is more than one to choose from, a Storage profile and a Rendition profile. Create adds it. These two profiles are chosen once: they cannot be changed afterwards.
Each library’s Sync shows one of Up to date, Syncing, Paused, Waiting (files out of date and nothing running yet) or Needs attention, with Check now, Pause and Resume, and Details.
A library’s page
A library’s name opens its page (/admin/settings/media/libraries/<id>):
- Overview: Name, Address (slug), the Object key prefix its files are stored under, and when it was created. Open in Media opens its files, Rename renames it, and Delete library deletes it, but only an empty library that is not the default one.
- Contents: Files, Folders and Size, also Without trash.
- Where its files are: how many files, objects and bytes it has on each bucket.
- Storage: its Storage profile (local and cloud copies, and its buckets) and Rendition profile, shown read-only.
- Sync: the same state and controls as on the list.
- Viewing: Deep zoom (zoomable tiles for large images; currently locked with We are redoing how deep zoom works, so this switch is locked for now.) and Annotated thumbnails: follow the site’s choice (Site setting (on) or Site setting (off)), or set On or Off for this library. Changing the annotated-thumbnail choice does not redo existing thumbnails.
- History: who changed what in this library.
A library’s address stays the same when it is renamed.
User libraries
The User libraries card turns on libraries that belong to users:
- Allow user libraries: off by default.
- Allow their own buckets: lets users keep a library on their own S3-compatible bucket instead of the site’s storage.
- Libraries per user: how many libraries one user may own (10 by default).
- Storage per user (MB): how much of the site’s storage each user may use. Empty or 0 means No limit.
- Private links last (hours): how long a link to a file in a private library works (12 hours by default).
- Save.
What counts towards a user’s storage is the originals and renditions of the files in the libraries they own, whoever uploaded them. Each file counts once, however many copies a storage profile keeps. Files in the trash count until they are purged, and a library kept on the user’s own bucket does not count. An upload that would take the owner over the limit is refused; nothing already stored is removed.
Below the settings, every user library is listed: Name, Owner, Visibility (Private, Signed-in users or Public), Storage, Members, Files, Size, Trashed and Suspended. Only the metadata is shown here, not the files. The row actions:
- Suspend (and Restore to bring it back online): a suspended public library answers as private, with nothing deleted.
- Settings: opens Library settings for that library.
- Open: opens the library’s files. Opening a user’s library is recorded in the audit log.
What users see
The permission that lets people use libraries is Storage, with Create libraries, Use their own storage (which also needs the personal Integrations permission) and Make libraries public. While user libraries are on, holders of Storage have:
- a Media tab on their profile settings (
/profile/settings/media) under My libraries: Create library, and for each library Open, Verify library, Settings, Rename, Make default, Members, Renditions, Storage and backups and Trash. Libraries others share with them are under Shared with me. - a Libraries entry in the admin sidebar (
/admin/libraries), listing The libraries you own or are a member of. A holder of Media finds them in the Media page’s switcher instead.
Members have one of four roles: Owner, Manager, Contributor or Viewer. A viewer browses the library read-only.
An Owner or Admin also sees Other users’ libraries on /admin/libraries and can open them; each opening is written to the audit log. The Storage permission alone never opens someone else’s library.
What it doesn’t do
- Nothing moves between libraries: a file or folder cannot be moved or linked into another library’s folder.
- A library’s storage profile and rendition profile cannot be changed after it is created.
- The default library, and a library that still holds files, cannot be deleted.
- A user library’s files never appear in the site’s Media library.
- PhoenixKit does not give every new account a library of its own. A site that wants that sets it up in code.