Access allows you to limit the front-end (read) access to specific pages, posts or custom types. You can define who can access the full content and what others, without full access, see.

Create or Join Access Groups

When you edit content, you will see the Post group metabox in the WordPress editor.

 

Access metabox in the WordPress content editor
Access metabox in the WordPress content editor

A post group is a set of read access settings, shared by a group of content entries. A group of content entries may contain as little as one post or any number of posts.

To be able to add posts and pages to a Post or a WPML group, the post type that they belong to must be managed by the Access plugin. You can set this on the Toolset -> Access Control page.

When you first use this feature, your site will have no post groups. Click on the button to change post group and create a new one. Then, you can add other posts to that group or create new groups.

Please note that since the Access version 2.3.2, it is not possible to add items belonging to the Media (attachments) post type, to the Post groups.

User Roles Capabilities for Post Groups

The Access plugin allows you to specify two new capabilities for your custom user roles:

  • allow user role to select post groups for their contents
  • allow user role to create new post groups for the contents

 

Access Assign or Create Custom Group
Access Assign or Create Custom Group

 

For example, this can be useful in situation where you might want to allow particular users to select groups for posts, but you do not want them to be able to create new groups.

WPML Groups

The Access plugin also allows you to create WPML groups and select read permissions based on the language.

You can create WPML groups and edit the existing ones from the WPML Groups tab on the Toolset -> Access Control page.

Click to create a new WPML group and then select the post type and the language you want to use.

WPML group for Posts and the English language
WPML group for Posts and the English language

Set Permissions for Post Group

If a post belongs to a post group, you can edit the read permissions to it. Click on Edit GROUP_NAME group privileges (GROUP_NAME is the name of the actual group you have created). This takes you to the Access Control screen, pointing at the tab for post groups.

 

Custom Groups
Custom Groups

The group read setting includes a row with the read permission for each role in your website.

Choosing What to Display for People Without Read Permission

There are two specific places where you can choose what to display for people without read permission, as shown in the following table.

Editing the global option for all user roles Editing the option for specific user role

When you uncheck the read permission, you can choose what to output instead of the content.

Choose what to display to people without read access
Choose what to display to people without read access

You can select from the following options:

  • Default error, the one selected for all user roles.
  • A 404 page, indicating that this content doesn’t exist.
  • The current page rendered using a template layout or, in case you are not using Layouts, a Content Template.

The third option allows you to display teasers for the content or any other text that you choose. Simply select a template layout you wish to render, usually, you will want to create a layout specific for this use. You can use it to display your sign-up messages or any other information which indicates to the reader that they need to log in or buy something from you to gain access.

Previewing what users without permission see

In the dialog box for selecting what users without permission see, there is a Preview error for GROUP_NAME link. Clicking it displays a page belonging to the Post group, and automatically “simulates” the selected user role and a post belonging to the related post type.

Please note that the preview only works for administrators. Additionally, the related post type needs to have at least one existing post.