Skip to content

Permissions & Access Control

Media ships five granular ProcessWire RBAC permissions and enforces defense-in-depth across authenticated APIs, file uploads, storage paths, and public share galleries.

Permission Scope Capabilities Granted
media-admin Full administration Full access to Library, Trash, Crop Presets, Shares, Disks & Tools, Settings, and Private Vault metadata audit (vault-list / vault-sign).
media-view Read-only browsing Open Setup > Media, browse folders and collections, search, preview in Quick Look, and inspect asset metadata.
media-upload Editorial authoring Upload files, replace files in place, edit metadata/alt/tags/color labels, manage folders and collections, run Crop Studio, and import Stock Media or embeds.
media-delete Lifecycle deletion Move assets to Trash, restore trashed assets, and permanently delete assets or folders (subject to delete_policy).
media-share External sharing Create, view, revoke, and regenerate public shareable gallery links under Setup > Media > Shares.

ProcessMedia::checkAccess() and canAccessSection() enforce these permissions per route so editors only see the sections they are authorized to use.

  • CSRF & Demo Mode ($config->demo): Every mutating /_media/api/{action} request (all 37 actions in MediaApiGateway::MUTATING_ACTIONS) and every Setup > Media > Settings save validates ProcessWire $session->CSRF and rejects writes when $config->demo is true.
  • File & Pixel-Bomb Caps: UploadMetadataProcessor enforces max_upload_mb, extension + finfo MIME allowlists, ProcessWire $sanitizer->validateFile(), and a 64 MP pixel-bomb ceiling (16,384 px maximum axis).
  • Opt-In SVG Sanitization: SVG uploads are disabled by default (allow_svg = 0). When enabled, Media rejects <script>, DOCTYPE/ENTITY declarations, inline event handlers (onload, onclick), and unsafe href schemes.
  • Chunked Upload & Revision Path Containment: ChunkedUploadService locks each upload session’s public target disk, field, extension, and MIME at upload-init, rejects HTTP-supplied local paths (chunkPath / posterPath), and enforces $files->limitPath() plus symlink checks. AssetRepository::isSafeRevisionPath() verifies archived revisions remain strictly inside _revisions/{asset_id}/.
  • Type-Scoped Entries Guards: delete-folder, delete-preset, and save-folder verify $entry->type matches media_collections or media_crop_presets before mutating records.
  • SSRF Protection: StockMediaService and EmbedService validate HTTPS host allowlists and reject private or reserved DNS IP resolutions (FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE).

Next steps