<?php if (!defined('PmWiki')) exit();
/**
 * restrict_actions: require admin privilege for most actions (if not defined otherwise).
 * I tried to manage allowed actions with $HandleAuth, but could not disable "?action=search".
 * "*" = let anyone do it (if the other modules allow it), "-" = nobody may do this
 **/

SDVA($RequiredPermissionLevels, array(
  'browse'   => 'read',
    'print'  => 'read',
  'edit'     => '*',
    'diff'   => 'edit',
    'source' => 'edit',
  'attr'     => '*',
  'upload'   => '*',
  'login'    => '*',
    'logout' => '*',
  ));

SDVA($RequiredPermissionLevels, array($action => '-'));

switch($RequiredPermissionLevels[$action])
{
  case '*': break;
  case '-': $action = 'browse';
  default: if (!CondAuth($pagename, $RequiredPermissionLevels[$action])) { $action = 'login'; }
}