Plugin Store

Using plugins

Plugin permissions

Understand the permission dialog — package permissions, code scopes, service API permissions and the domains a plugin connects to

5 min readLast updated

View as Markdown

On this page

A plugin can only do what it declares and an administrator approves — at install, at activation and whenever a new version asks for more. The same list is shown on the plugin's page of the store website (Permissions this plugin uses).

Package permissions#

permissionMeaning in the admin
headAdds code to the page head (.css/.js files on every page)
bodyEndAdds HTML/scripts at the end of the page
blocksAdds blocks to the designer
settingsHas its own settings page
webhooksSends event data (e.g. a new post) to an outside website
codeRuns JavaScript on the site's server (within the code scopes below)
serviceHas its own server-side program (WebAssembly in the CMS or a separate program)

Code scopes (JavaScript plugins)#

scopeWhat it allows
dbIts own tables and migrations (only p_<id>_* tables)
contentRead posts and pages
content-write ⚠Create, edit and delete posts/pages (with system rights)
content-fields ⚠Add fields to the post/page editor (stored in the plugin's own post meta)
mail ⚠Send email from the site
http ⚠Call outside websites — only domains the plugin declares and the admin allows
webhooks ⚠Send webhooks to any URL (public addresses only)
visitor ⚠Identify the site's visitors/members
filters-core ⚠Change system data through the core filters (content, head, email…)
routesAdd public pages/addresses to the site (declared paths only)
post-typesDeclare content types of its own (since CMS 2.0.5)
admin-pagesAdd admin pages, dashboard widgets and notice banners
jobsBackground and scheduled (cron) jobs
middlewareRuns before every public page request (can answer instead of the page, or redirect)
head-scriptsInserts unfiltered scripts/HTML into every page

⚠ = the admin marks it Important permission — make sure you trust the developer

head-scripts equals putting raw HTML on every page, and middleware can answer for any page. Even without the warning badge, approve them only for plugins you trust, such as the official Custom code and Maintenance plugins.

JavaScript plugins do not get direct SQL (db.query), cannot see the CMS's or other plugins' tables, and cannot see the system's or other plugins' cookies.

Service API permissions (WebAssembly / external service)#

PermissionMeaning
siteRead site data (name, logo, theme)
mailSend email through the site's email system
contentRead published posts and pages
usersRead user data (name, email, role)
eventsSend events to other plugins
storageKeep its own data in the plugin storage
httpCall outside services, only the listed domains (e.g. a payment gateway)

When a new version asks for more#

If an update asks for a permission, scope, API permission or domain the previous version did not have, the system:

  1. Updates the files but switches the plugin off
  2. Shows "This version asks for more permissions than vX — off until you approve" with the list of additions
  3. Switches it on again when an administrator presses Approve and activate

Permissions of installed plugins#

The cards on the Installed tab show the code scopes, the site addresses used, the domains it may call and the plugins it needs. Domains a plugin calls with http must also be on the site's allow list (set under Site Code → Secrets & settings).