Skip to main content

Overview

Vasyl MartyniukAbout 1 min

The access policy is a well-structured JSON document that contains one or more statements, params, and dependencies that collectively define access controls and settings for the entire WordPress instance.

In general, a policy may have three properties. All are optional and used depending on a policy intent.

{
    "Dependency": {},
    "Statement": [],
    "Param": []
}
  • The Dependency property does not affect how policy function and is only used to emphasize the minimum required dependencies for the defined statements to work properly.
  • The Statement property can be either an object or an array of objects that contain one or more statements.
  • The Param property also can be either an object or an array of objects that contain one or more policy params.

To learn more about each property and how they function, refer to the next articles in this section. We will uncover in greater detail how to define statements and params that can be used to define the most sophisticated access controls for AAM plugin or even for your custom functionality.

User Interface

The access policy, in its nutshell, is a custom post type, so it has a similar UI as any post or page. The difference is in who can access policies and how the list of policies is displayed.

When you navigate to the AAM page, you can find the "Access Policies" tab that renders the list of all known policies on the site. Here you can manage the list of existing policies and create new ones.

AAM Access Policies Tab

Note!

If you do not see the "Access Policies" tab as administrator, you likely have the "Access Policies" service disabled. Go to the AAM Settings page and search for the access policies on the "Services" tab. Then enable the service.

The policy edit screen has similar look and feel to the classical post edit page. Here you can prepare a policy document, assign it to any role, user, visitor, or to everyone, and publish a ready policy.

AAM Edit Policy Screen

Another good part about access policies is that WordPress core automatically stores all the policy revisions. You can quickly find out who made the changes, when, and if necessary, revert to a previous revision.

AAM Access Policies Revisions

FYI!

You can toggle what widgets to display on the policy edit screen by selecting the "Screen Options" button on the top corner of the screen.