Node Privacy By Role and CCK

One very useful module in Drupal is the Node Privacy By Role module. It allows the automatic setting of viewing and editing permissions on nodes according to the users role. It is not as fine grained as one that operates on the node and the usesr, but it is very useful for making newly created content automatically available to selected roles.

In conjunction with CCK it makes kinds of publishing very easy. Consider this website for example, although it declares itself to be a blog, I am bound to create stuff I don't want everyone to see in the future.

All my regular articles are of a content type named Devblog Article. When you navigate to the Content management | Content types | Edit Devblog Article using the Admin Menu you see Node Privacy by Role as one of the collapsible areas on the page. Expanding it gives you the permissions for View|Edit|Update|Delete for all roles when a new Devblog Article is created. It is very useful because whenever I create a new Devblog Article I know what permissions have been set, and I can automatically publish it without worrying whether people will see content that should be restricted. In the case of Devblog Article I have allowed View permissions to all users ie, Anonymous and Authenticated. All the others are blank.

The beauty of this is that Devblog Article is not a CCK type that uses additional CCK fields, it is simply the default node type with Title and Body given the name 'Devblog Article', and all these settings are applied to a new node of this type. This makes it much more convenient than using a built in Drupal type like Page, Story or Blog, the having to change the settings on its creation as there can be a lot of them.

With the Acquia distribution for instance there is the option of printing out the article as a PDF file. If I create technical articles that readers might want to print for reference, or create such articles on a company intranet for instance, I can create a content type named PDF Friendly and set the defaults to enable PDF printing. This is one of the great benefits of CCK and Node Privacy by Role.

0
Your rating: None

Comments

Ginsannuash

I wish those involved in the

I wish those involved in the dispute would consider the difficulties of those of us attempting to organize in cities without UNITE or HERE. Our struggle is hard enough, sexy lingerie bedroom furniture and now we have to fudge the stability of the union we're supposedly fighting to represent us

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options