— go to the documentation home page
MediaFlow documentation

Permissions and Capabilities

Which WordPress capability each MediaFlow action needs, why per-attachment checks matter, and how licensing is a separate gate from permissions.

Documents version1.5.1

Last updated

On this page

MediaFlow enforces permissions on the server, in the services as well as at the REST layer. Hidden interface controls are never the access control.

The capability gates

Action Capability
View folders and organize media upload_files
Create, rename, move and delete folders manage_categories
Change settings and run a refresh manage_options

All three are filterable through mediaflow_capability.

Per-attachment checks

Beyond the screen-level capability, MediaFlow checks edit_post on each attachment, so an author cannot reorganize media belonging to somebody else.

Items a user is not allowed to edit are skipped and reported, never silently ignored — a bulk move of twelve items where two belong to someone else moves ten and says so.

The REST surface

MediaFlow’s interface writes through one REST namespace, mediaflow/v1:

Route Purpose
GET /tree Read the folder tree.
POST /folders Create a folder.
POST|DELETE /folders/<id> Update or delete a folder.
POST /media/assign Move media between folders.
POST /refresh Run a batch of the full refresh.

Every route has a permission callback and typed arguments. None uses __return_true. The bulk folder picker is a POST form protected by a nonce.

Three separate gates

MediaFlow asks three different questions before it does anything, and all three are enforced on the server:

Gate Question
Capability May this user do it?
Tier Is this feature part of what an unpaid site gets?
Licence Is this site paid up?

Per-role folder visibility is a fourth thing again, and not a security boundary: it controls what the folder tree shows, while capabilities control what may actually be done. An administrator always sees every folder.

See Free vs Pro for which features sit on which side of the tier gate, and Working without a licence for what happens when one lapses.

Frequently asked questions

Can I let editors manage folders without giving them manage_options?

Folder management already needs only manage_categories, which editors have by default. Settings and the refresh need manage_options.

Can I open folder management to a custom role?

Yes, with the mediaflow_capability filter — see Filters and hooks.

Why can an author see folders they cannot edit media in?

Viewing the tree needs upload_files. Changing an individual attachment needs edit_post on that attachment, which is checked separately.