Access control

Note that some aspects of access control have been changed in Drupal 6.2. This handbook pages reflects these API changes (more).

The access callback and the access arguments decide whether the user has access to a given menu entry or not.

  $items['admin/user/roles'] = array(
    'title' => 'Roles',
    'description' => 'List, edit, or add user roles.',
    'access callback' => 'user_access',
    'access arguments' => array('administer access control'),
  );

The menu system will call the function user_access with the arguments administer access control.

If your module defines access arguments but does not define an access callback, then the menu system defaults to using user_access as the access callback. In other words:

  $items['admin/user/roles'] = array(
    'title' => 'Roles',
    'description' => 'List, edit, or add user roles.',
    'access arguments' => array('administer access control'),
  );

is equivalent to:

<?php
$items['admin/user/roles'] = array(
'title' => 'Roles',
'description' => 'List, edit, or add user roles.',
'access callback' => 'user_access', // menu system adds this callback automatically

Wildcard, ancestors and fitness

Our big problem is that there are paths like node/12345/edit. To handle these and others, we use a wildcard: the percent sign. So, when the system tries to find which {menu_router} entry specifies node/12345/edit it will look at the menu definitions of the following paths:

  • node/12345/edit
  • node/12345/%
  • node/%/edit
  • node/%/%
  • node/12345
  • node/%
  • node

These we call the ancestors of node/12345/edit.

Fit

As a wildcard is less specific than the path itself -- for example, if we defined a {menu_router} entry for node/12345/edit it will only deal with this one node only but node/%/edit deals with all nodes. We can say that node/12345/edit is a better fit than node/%/edit.

So let's add fitness number to these paths:

Path Fitness Fitness in binary
node/12345/edit 7 111
node/12345/% 6 110

Scheduler: Automate Node Publishing / Unpublishing

Scheduler module

This module allows nodes to be published and unpublished on specified dates and times.

Dates can be entered either as plain text or via selection from a Javascript pop-up calendar via JSCalendar in Drupal 5 or Date module in Drupal 6 and Drupal 7.

Sofaspace Ambient Radio

The Sofaspace Ambient Radio is powered by Drupal 6:

http://www.sofaspace.net/

The theme is a port of Andreas09 which I had to modify manually since there was no official port available. I'll release it as soon as I find the time to clean it up. I'm planning to replace the osCommerce shop with Drupal as soon as the functionality I need is available. That's going to be a difficult task but I'm sure it will work out somehow. osC is a bitch. Drupal is so much nicer to work with.

Adding the TinyMCE header plugin

Formating controls for headings (h1, h2, h3...) are not included in the base TinyMCE package. However there is a 3rd Party TinyMCE plugin that provides this.

Pages

Subscribe with RSS Subscribe to RSS - Drupal 6.x