From 72065fb8351b54eee5f1928c18e06ad81aa9b502 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 20 Jun 2001 20:00:40 +0000 Subject: - Added a brand-new access.module which allows you to manage 'roles' (groups) and 'permissions' ... (inspired by Zope's system). + Once installed, click the help-link for more information. + See updates/2.00-to-x.xx.sql for the SQL updates. - Modified loads of code to use our new access.module. The system still has to mature though: new permissions have to be added and existing permissions need stream-lining. Awaiting suggestions. - As a direct result of the new access system, I had to rewrite the way the top-level links in admin.php are rendered and displayed, and xhtml-ified admin.php while I was at it. TODO - Home-brewed modules need updating, home-brewed themes not. (Examples: file.module, trip_link.module) - As soon we *finished* the refactoring of the user system (KJ has been working on this refactoring already) we should consider to embed this role and permission code into account.module ... --- modules/meta.module | 78 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 44 insertions(+), 34 deletions(-) (limited to 'modules/meta.module') diff --git a/modules/meta.module b/modules/meta.module index a46857ec1..092bf1d4c 100644 --- a/modules/meta.module +++ b/modules/meta.module @@ -6,6 +6,10 @@ function meta_help() { add new collection | add new meta-tag | preview node forms | overview | help
\n"; - - switch ($op) { - case "add": - if ($type == "collection") - print meta_form_collection(); - else - print meta_form_tag(); - break; - case "edit": - if ($type == "collection") - print meta_form_collection(meta_get_collection($id)); - else - print meta_form_tag(meta_get_tag($id)); - break; - case "help": - print meta_help(); - break; - case "preview": - print meta_preview(); - break; - case "Delete": - $edit[name] = 0; - // fall through: - case "Submit": - if ($type == "collection") - print status(meta_save_collection($edit)); - else - print status(meta_save_tag($edit)); - // fall through: - default: - print meta_overview(); + global $user, $edit, $type, $op, $id; + + if (user_access($user, "add and edit meta tags")) { + + print "add new collection | add new meta-tag | preview node forms | overview | help
\n"; + + switch ($op) { + case "add": + if ($type == "collection") + print meta_form_collection(); + else + print meta_form_tag(); + break; + case "edit": + if ($type == "collection") + print meta_form_collection(meta_get_collection($id)); + else + print meta_form_tag(meta_get_tag($id)); + break; + case "help": + print meta_help(); + break; + case "preview": + print meta_preview(); + break; + case "Delete": + $edit[name] = 0; + // fall through: + case "Submit": + if ($type == "collection") + print status(meta_save_collection($edit)); + else + print status(meta_save_tag($edit)); + // fall through: + default: + print meta_overview(); + } + } + else { + print message_access(); } } -- cgit v1.2.3