Action interface

A JavaScript object implementing the Action interface represents the rules for deciding whether a given user is permitted to perform an action.

Construction

Use O.action() while your plugin is loading.

Interface (setup)

Every setup function returns the action object, making them suitable for chaining.

function title(title)

Specify the name of this action, suitable for displaying to administrative users.

function allow(kind, thing)

Add an allow rule to the action. A user must match at least one allow rule.

kind specifies which kind of rule. The platform implements two kinds,

"all" Matches all users
"group" The user is a member of the group passed as thing

Plugins can extend the action system to implement other kind options.

function deny(kind, thing)

Add a deny rule to the action. A user must not match any deny rules.

Interface (utility)

property code

The API code of this action.

function enforce(message)

Check to see if the current user is allowed to perform this action, and if not, call O.stop() with the given message, or a default message if it is not specified.