wiki perms
This commit is contained in:
parent
ee4b223f65
commit
ea90e21d86
2 changed files with 6 additions and 9 deletions
|
@ -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
|
* 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;
|
if($page->is_locked()) return false;
|
||||||
|
|
||||||
// anon / user can edit if allowed by config
|
// anon / user can edit if allowed by config
|
||||||
if($config->get_bool("wiki_edit_anon", false) && $user->is_anonymous()) return true;
|
if($user->can("edit_wiki_page")) return true;
|
||||||
if($config->get_bool("wiki_edit_user", false) && !$user->is_anonymous()) return true;
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,6 +68,9 @@ new UserClass("base", null, array(
|
||||||
"create_image_report" => False,
|
"create_image_report" => False,
|
||||||
"view_image_report" => False, # deal with reported images
|
"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)
|
"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,
|
"mass_tag_edit" => True,
|
||||||
"create_image_report" => True,
|
"create_image_report" => True,
|
||||||
"view_image_report" => True,
|
"view_image_report" => True,
|
||||||
|
"edit_wiki_page" => True,
|
||||||
|
"delete_wiki_page" => True,
|
||||||
"protected" => True,
|
"protected" => True,
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|
Reference in a new issue