{"id":24511,"date":"2012-11-09T08:49:53","date_gmt":"2012-11-09T08:49:53","guid":{"rendered":"https:\/\/toolset.com\/?post_type=course-lesson&#038;p=24511"},"modified":"2020-11-16T10:05:59","modified_gmt":"2020-11-16T10:05:59","slug":"setting-access-control","status":"publish","type":"course-lesson","link":"https:\/\/toolset.com\/fr\/course-lesson\/setting-access-control\/","title":{"rendered":"Access Control for Standard and Custom Content Types"},"content":{"rendered":"<div class=\"wp-block-image\">\n<figure class=\" tb-image tb-image-media aligncenter\" data-toolset-blocks-image=\"bd9a51f062c9ee247264bd25bbdced56\"><a href=\"https:\/\/toolset.com\/wp-content\/uploads\/2019\/09\/toolset-access-post-types-tab.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/toolset.com\/wp-content\/uploads\/2019\/09\/toolset-access-post-types-tab-500x164.png\" alt=\"Editing access control for post types\" class=\"wp-image-1343017\"\/><\/a><div class=\"tb-image-caption\"><figcaption>Editing access control for post types<\/figcaption><\/div><\/figure>\n<\/div>\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Access also manages user access to post field groups, Toolset forms, WPML, and WooCommerce.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Managing Access Control for Posts, Pages and Custom Post Types<\/h2>\n\n\n\n<p>Access controls for posts, pages, and <a href=\"https:\/\/toolset.com\/fr\/glossary\/custom-post-type\/\">custom post types<\/a> look like this:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\" tb-image tb-image-media aligncenter\" data-toolset-blocks-image=\"f6e1228e916d4c1619a5c2b00ece8aaf\"><a href=\"https:\/\/toolset.com\/wp-content\/uploads\/2012\/11\/access-post-settings-1.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/toolset.com\/wp-content\/uploads\/2012\/11\/access-post-settings-1-500x427.png\" alt=\"Access control for posts\" class=\"wp-image-427509\"\/><\/a><div class=\"tb-image-caption\"><figcaption>Access control for posts<\/figcaption><\/div><\/figure>\n<\/div>\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>To allow Access to manage that content type, click on the&nbsp;<strong>Managed by Access<\/strong>&nbsp;checkbox at the top of each section and then on the&nbsp;<strong>Save&nbsp;<\/strong>button for that post type. Note that custom post type sections feature two additional options for managing their access control, as displayed in the following image.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\" tb-image tb-image-media aligncenter\" data-toolset-blocks-image=\"4765b2001d3bf11be14672a85a3e0369\"><a href=\"https:\/\/toolset.com\/wp-content\/uploads\/2017\/05\/toolset-access-control-options-for-custom-post-types.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/toolset.com\/wp-content\/uploads\/2017\/05\/toolset-access-control-options-for-custom-post-types-500x229.png\" alt=\"Access control options for custom post types\" class=\"wp-image-525155\"\/><\/a><div class=\"tb-image-caption\"><figcaption>Access control options for custom post types<\/figcaption><\/div><\/figure>\n<\/div>\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>The additional options are the following;<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>You can set the custom post type to use the same read permission as regular Posts.<\/li><li>You can use the default WordPress read permissions for the custom post type.<\/li><\/ul>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>After selecting how the post type is managed, you can select the checkboxes to choose what operations different users can do. The ones selected by default are the standard WordPress permissions. The privileges that you can select are:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Read<\/strong>&nbsp;\u2013 read the content on the front-end<\/li><li><strong>Edit own<\/strong>&nbsp;\u2013 create new content and edit the content that each user has created<\/li><li><strong>Delete own<\/strong>&nbsp;\u2013 delete the content that each user has created<\/li><li><strong>Edit any<\/strong>&nbsp;\u2013 edit content created by other users<\/li><li><strong>Delete any<\/strong>&nbsp;\u2013 delete content created by other users<\/li><li><strong>Publish<\/strong>&nbsp;\u2013 public content<\/li><li><strong>Preview any<\/strong>&nbsp;\u2013 preview the content before it\u2019s published<\/li><\/ul>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>To grant privileges to specific users, click on the user icon and start typing the username in the dialog\u2019s text field. Access will auto-complete and let you select users.Please note that when a static page is set as a Blog page on the WordPress&nbsp;<strong>Settings<\/strong>&nbsp;page, Access cannot apply permissions to that page, as it becomes an archive and is not a standard page anymore.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Access control for comments<\/h2>\n\n\n\n<p>The Access plugin allows you to control which comments user roles are able to moderate. The workflow is a bit different for standard Posts and custom post types.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Comments for the standard Posts type<\/h3>\n\n\n\n<p>To control permissions for moderating comments, you need to make sure to select that&nbsp;<strong>Posts<\/strong>&nbsp;are managed by Access. For a user role to be able to edit&nbsp;<strong>its own<\/strong>&nbsp;comments&nbsp;it needs to have the&nbsp;<strong>Publish&nbsp;<\/strong>and&nbsp;<strong>Edit own&nbsp;<\/strong>capabilities for Posts.&nbsp;For a user role to be able to edit&nbsp;<strong>all<\/strong>&nbsp;comments&nbsp;it needs to have the&nbsp;<strong>Publish&nbsp;<\/strong>and&nbsp;<strong>Edit any&nbsp;<\/strong>capabilities for Posts.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Comments for custom post types<\/h3>\n\n\n\n<p>To control permissions for moderating comments, you need to make sure to select that your&nbsp;<strong>custom post type and the standard Post and Pages<\/strong>&nbsp;are all managed by Access.&nbsp;For a user role to be able to edit&nbsp;<strong>its own<\/strong>&nbsp;comments&nbsp;it needs to have the&nbsp;<strong>Publish&nbsp;<\/strong>and&nbsp;<strong>Edit own&nbsp;<\/strong>capabilities for that custom post type and the standard Posts.&nbsp;For a user role to be able to edit&nbsp;<strong>all<\/strong>&nbsp;comments&nbsp;it needs to have the&nbsp;<strong>Publish&nbsp;<\/strong>and&nbsp;<strong>Edit any&nbsp;<\/strong>capabilities for that custom post type and the standard Posts.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Choosing what to Display When Read Access is Denied<\/h2>\n\n\n\n<p>The \u201cread\u201d privilege is specific. When you disallow reading, you can choose what to display for users without access.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Selecting default error display for all user roles<\/h3>\n\n\n\n<p>For any post type controlled by Access, you can select a default content to show when read access is denied.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\" tb-image tb-image-media aligncenter\" data-toolset-blocks-image=\"f6a1884ae765a72dff180d499de66d0f\"><a href=\"https:\/\/toolset.com\/wp-content\/uploads\/2020\/09\/toolset-access-error-display-archive-pages.png\"><img decoding=\"async\" width=\"532\" height=\"382\" loading=\"lazy\" src=\"https:\/\/toolset.com\/wp-content\/uploads\/2020\/09\/toolset-access-error-display-archive-pages.png\" alt=\"Selecting what to display for archives for users without read permission\" class=\"wp-image-1787301\" srcset=\"https:\/\/toolset.com\/wp-content\/uploads\/2020\/09\/toolset-access-error-display-archive-pages.png 532w, https:\/\/toolset.com\/wp-content\/uploads\/2020\/09\/toolset-access-error-display-archive-pages-300x215.png 300w, https:\/\/toolset.com\/wp-content\/uploads\/2020\/09\/toolset-access-error-display-archive-pages-150x108.png 150w\" sizes=\"auto, (max-width: 532px) 100vw, 532px\" \/><\/a><div class=\"tb-image-caption\"><figcaption>Selecting the default display when user access is denied<\/figcaption><\/div><\/figure>\n<\/div>\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Selecting error display for a specific user role<\/h3>\n\n\n\n<p>You can also specify what to display when read access is denied for a specific user role. The icon to edit these options appears when you deselect the read permission for a given role.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\" tb-image tb-image-media aligncenter\" data-toolset-blocks-image=\"b35bc52e912a57514015aee659177991\"><a href=\"https:\/\/toolset.com\/wp-content\/uploads\/2017\/05\/toolset-access-selecting-error-when-no-read-access-for-specific-user-role.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/toolset.com\/wp-content\/uploads\/2017\/05\/toolset-access-selecting-error-when-no-read-access-for-specific-user-role-500x236.png\" alt=\"Selecting what to display when a specific user role has no read access\" class=\"wp-image-524872\"\/><\/a><div class=\"tb-image-caption\"><figcaption>Selecting what to display when a specific user role has no read access<\/figcaption><\/div><\/figure>\n<\/div>\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Options for error&nbsp;display<\/h3>\n\n\n\n<p>When selecting what to display when a user has no read access, you can choose from the following options.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Default error, the one selected for all user roles.<\/li><li>A 404 page, indicating that this content does not exist.<\/li><li>The current page, displayed using a <a href=\"https:\/\/toolset.com\/fr\/glossary\/template\/\">Content Template<\/a>.<\/li><\/ul>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Selecting error display for archive pages<\/h3>\n\n\n\n<p>For custom post types, which do not include Pages and Media, you can also select what to display on the archive page for user roles without the&nbsp;read permissions. You can choose from the following options for&nbsp;<a href=\"https:\/\/toolset.com\/fr\/glossary\/archive\/\">archive<\/a>&nbsp;pages:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Display the \u201cNo posts found\u201d message.<\/li><li>Choose a different PHP template to render the contents. This option is available if the Toolset Blocks plugin are not active.<\/li><li>Choose a WordPress Archive to display the error. To see this option you need to have at least one WordPress Archive created with Toolset Blocks.<\/li><\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\" tb-image tb-image-media aligncenter\" data-toolset-blocks-image=\"19d7a0d13ae26f167947bcd325402824\"><a href=\"https:\/\/toolset.com\/wp-content\/uploads\/2020\/09\/toolset-access-error-display-archive-pages.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/toolset.com\/wp-content\/uploads\/2020\/09\/toolset-access-error-display-archive-pages-500x359.png\" alt=\"Selecting what to display for archives for users without read permission\" class=\"wp-image-1787301\"\/><\/a><\/figure>\n<\/div>\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Previewing what users without permission see<\/h3>\n\n\n\n<p>In the dialog box for selecting what users without permission see, there is a&nbsp;<strong>Preview error for POST_TYPE&nbsp;<\/strong>link. POST_TYPE is the name of the respective post type you are editing. Clicking it displays a page belonging to the Post type, and automatically \u201csimulates\u201d 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.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"taxonomy\">Managing Access Control to Taxonomy<\/h2>\n\n\n\n<p>Access control for taxonomy, including tags, categories and all custom taxonomy, looks like this:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\" tb-image tb-image-media aligncenter\" data-toolset-blocks-image=\"475f87ea38bd7d513ff9918e4322fe13\"><a href=\"https:\/\/toolset.com\/wp-content\/uploads\/2012\/11\/access-category-settings-1.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/toolset.com\/wp-content\/uploads\/2012\/11\/access-category-settings-1-500x424.png\" alt=\"\" class=\"wp-image-1685207\"\/><\/a><div class=\"tb-image-caption\"><figcaption>Access control for categories<\/figcaption><\/div><\/figure>\n<\/div>\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Similarly to post types, to enable access management for <a href=\"https:\/\/toolset.com\/fr\/glossary\/template\/\">taxonomy<\/a>, you must click on the&nbsp;<strong>Managed by Access<\/strong>&nbsp;checkbox. Taxonomy access management includes another option, called \u201cSame as Category\u201d. When selected, the access rules are set according to the settings for WordPress built-in Categories. For example, it will mean that the taxonomy is available when categories are. Please note that this option is only available if the taxonomy belongs to a single post type, or all post types that have this taxonomy have the same access rules. The privileges that you can select for taxonomy are:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Manage terms<\/strong>&nbsp;\u2013 access the taxonomy <a href=\"https:\/\/toolset.com\/fr\/glossary\/taxonomy-term\/\">terms<\/a> list<\/li><li><strong>Edit terms<\/strong>&nbsp;\u2013 edit any term<\/li><li><strong>Delete terms<\/strong>&nbsp;\u2013 delete terms<\/li><li><strong>Assign terms<\/strong>&nbsp;\u2013 assign terms to their respective post types<\/li><\/ul>\n\n\n\n<p>You can also grant taxonomy access privileges to specific users, by clicking the user icon and entering their names in the search text field.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Access permissions for feeds<\/h2>\n\n\n\n<p>The Access plugin features a new logic for controlling the WordPress feeds\u2019 visibility on the front-end. The permissions you assign to the specific user role for a specific contents (post types) are also used to control the visibility of those contents in the feeds on the front-end. For example, if you restrict users with the role guest (i.e. the ones not logged in), not only will they be restricted from viewing certain contents on the front-end but those contents also will not appear for them in the feeds.<\/p>\n","protected":false},"author":4341,"featured_media":1664495,"template":"","related-lesson":[8431],"class_list":["post-24511","course-lesson","type-course-lesson","status-publish","has-post-thumbnail","hentry","related-lesson-access-control"],"_links":{"self":[{"href":"https:\/\/toolset.com\/fr\/wp-json\/wp\/v2\/course-lesson\/24511","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/toolset.com\/fr\/wp-json\/wp\/v2\/course-lesson"}],"about":[{"href":"https:\/\/toolset.com\/fr\/wp-json\/wp\/v2\/types\/course-lesson"}],"author":[{"embeddable":true,"href":"https:\/\/toolset.com\/fr\/wp-json\/wp\/v2\/users\/4341"}],"version-history":[{"count":8,"href":"https:\/\/toolset.com\/fr\/wp-json\/wp\/v2\/course-lesson\/24511\/revisions"}],"predecessor-version":[{"id":1787309,"href":"https:\/\/toolset.com\/fr\/wp-json\/wp\/v2\/course-lesson\/24511\/revisions\/1787309"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/toolset.com\/fr\/wp-json\/wp\/v2\/media\/1664495"}],"wp:attachment":[{"href":"https:\/\/toolset.com\/fr\/wp-json\/wp\/v2\/media?parent=24511"}],"wp:term":[{"taxonomy":"related-lesson","embeddable":true,"href":"https:\/\/toolset.com\/fr\/wp-json\/wp\/v2\/related-lesson?post=24511"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}