Quản lý hiện thị Drupal Nodes bằng content Access.module

Quản lý hiện thị Drupal Nodes bằng content Access.module

Sometimes in Drupal there are many solutions to a problem.

One such problem is controlling who can see which content on your site.

Although Drupal comes with 5 permissions for content, none of them deal with access. Here are the 5 default permissions:

media_1355779199660.png

In this list, you can see create, edit and delete but you can't see view.

There are a lot of solutions to this problem. In this tutorial, we're going to introduce you to one of them: the Content Access module. This week we've always recommended Taxonomy Access.

What's the difference between these two modules?

  • Content Access works best if your user roles closely match your content types.
  • Taxonomy Access Control works best if you have a more complicated permissions system and one that doesn't closely match your content types.

Access Control for Content Types

  • Install Content Access from https://drupal.org/project/content_access
  • Enable the module.
  • Go Structure > Content Types
  • Click Manage fields next to the content type you want to edit.
  • You'll notice a new tab called Access Control at the top of the page. Click that tab.

Quản lý hiện thị Drupal Nodes bằng content Access.module

  • You'll now be able to contol which user roles can view this content:

media_1355780152910.png

Access Control for Single Nodes

Content Access can also be more flexible if needed. You can apply permissions to individual nodes.

  • Make sure you are on the Manage fields > Access Control page that we saw above.
  • Click the "Enable per content node access control settings" box.
  • Visit a content item that's in this content type.
  • You'll see an Access Control tab where you can control the permissions for just this node.

media_1355780250508.png

Access Control Customized for Your Needs

You can make Content Access act in much more sophisticated ways by using the Rules module. Content Access is fully integrated with Rules, so you can automatically set permissions for different types of content.

  • Install Rules.
  • Enable both the Rules and Rules UI modules.
  • Enable the Content Access Rules Integrations module.

In the example we're going to show you, we have a user role called "Writers" . These people will add content to our site, but we don't want their content to be visible by everyone. We only want it to be visible to people in another user role called "Editors". Here's how we can set this up:

  • Go to Configuration, then Rules.
  • Click "Add new rule".

media_1355782679121.png

  • Click Add condition.
  • Choose If Users has roles.
  • For Data selector, choose node:author.
  • For Roles, choose Writers.
  • Click Save

media_1355782789281.png

  • Click Add action.
  • Choose Grant Access by role.
  • Give the Editors the ability to view the content.

media_1355783035437.png

Bạn thấy bài viết này như thế nào?: 
No votes yet
Ảnh của Khanh Hoang

Khanh Hoang - Kenn

Kenn is a user experience designer and front end developer who enjoys creating beautiful and usable web and mobile experiences.

Tìm kiếm bất động sản

 

Advertisement

 

jobsora

Dich vu khu trung tphcm

Dich vu diet chuot tphcm

Dich vu diet con trung

Quảng Cáo Bài Viết

 
Hướng dẫn sử dụng QTP Framework – Framework Types, Examples

Hướng dẫn sử dụng QTP Framework – Framework Types, Examples

This page is your one stop repository for all the information about the different aspects of QTP frameworks

Hướng dẫn phân quyền trong Wordpress 3.4

Hướng dẫn phân quyền trong Wordpress 3.4

Wordpress thực sự mạnh mẽ cho cộng đồng bloger chuyên nghiệp, với những ưu điểm riêng biệt làm cho Wordpress ngày càng lớn mạnh và trở nên phổ biến. Bài viết này sẽ giới thiệu về các loại tài khoản dùng để phần quyền trong việc quản lý nội dung trong Wordpress, hiện tại Wordpress có 4 loại tài khoản chính là Admin, Editer, Author, Contributer, và Subsrciber

Android

5 Ứng dụng bảo vệ và khóa hình ảnh cho Android

Ngày nay điện thoại thông minh thường được trang bị một máy ảnh nhiều “chấm” với chất lượng ngày càng được cái tiến.

Công ty diệt chuột T&C

 

Diet con trung