Index: robotstxt.module =================================================================== RCS file: /cvs/drupal/contributions/modules/robotstxt/robotstxt.module,v retrieving revision 1.4.4.17 diff -u -r1.4.4.17 robotstxt.module --- robotstxt.module 21 Feb 2009 08:59:51 -0000 1.4.4.17 +++ robotstxt.module 26 Jun 2009 12:49:04 -0000 @@ -20,6 +20,13 @@ } /** + * Implementation of hook_perm(). + */ +function robotstxt_perm() { + return array('edit robots.txt'); +} + +/** * Implementation of hook_menu(). */ function robotstxt_menu() { @@ -33,7 +40,8 @@ 'description' => 'Manage your robots.txt file.', 'page callback' => 'drupal_get_form', 'page arguments' => array('robotstxt_admin_settings'), - 'access arguments' => array('administer site configuration'), + 'access callback' => '_robotstxt_access', + 'access arguments' => array('administer site configuration', 'edit robots.txt'), 'file' => 'robotstxt.admin.inc', ); @@ -83,3 +91,17 @@ return $content; } + +/** + * Check the multiple access permissions through 'OR' operator + */ +function _robotstxt_access() { + $is_ok = FALSE; + $perms = func_get_args(); + foreach($perms as $perm) + if(user_access($perm)) { + $is_ok = TRUE; + break; + } + return $is_ok; +} \ No newline at end of file