wiki perms

This commit is contained in:
Shish 2012-03-19 13:21:59 +00:00
parent ee4b223f65
commit ea90e21d86
2 changed files with 6 additions and 9 deletions

View file

@ -167,13 +167,6 @@ class Wiki extends Extension {
}
}
public function onSetupBuilding(SetupBuildingEvent $event) {
$sb = new SetupBlock("Wiki");
$sb->add_bool_option("wiki_edit_anon", "Allow anonymous edits: ");
$sb->add_bool_option("wiki_edit_user", "<br>Allow user edits: ");
$event->panel->add_block($sb);
}
/**
* See if the given user is allowed to edit the given page
*
@ -189,8 +182,7 @@ class Wiki extends Extension {
if($page->is_locked()) return false;
// anon / user can edit if allowed by config
if($config->get_bool("wiki_edit_anon", false) && $user->is_anonymous()) return true;
if($config->get_bool("wiki_edit_user", false) && !$user->is_anonymous()) return true;
if($user->can("edit_wiki_page")) return true;
return false;
}

View file

@ -68,6 +68,9 @@ new UserClass("base", null, array(
"create_image_report" => False,
"view_image_report" => False, # deal with reported images
"edit_wiki_page" => False,
"delete_wiki_page" => False,
"protected" => False, # only admins can modify protected users (stops a moderator changing an admin's password)
));
@ -106,6 +109,8 @@ new UserClass("admin", "base", array(
"mass_tag_edit" => True,
"create_image_report" => True,
"view_image_report" => True,
"edit_wiki_page" => True,
"delete_wiki_page" => True,
"protected" => True,
));