more perms
This commit is contained in:
parent
45772b9b7e
commit
f7f70b8600
@ -43,7 +43,7 @@ class AdminPage extends Extension {
|
||||
global $page, $user;
|
||||
|
||||
if($event->page_matches("admin")) {
|
||||
if(!$user->is_admin()) {
|
||||
if(!$user->can("manage_admintools")) {
|
||||
$this->theme->display_permission_denied();
|
||||
}
|
||||
else {
|
||||
@ -76,7 +76,7 @@ class AdminPage extends Extension {
|
||||
|
||||
public function onUserBlockBuilding(UserBlockBuildingEvent $event) {
|
||||
global $user;
|
||||
if($user->is_admin()) {
|
||||
if($user->can("manage_admintools")) {
|
||||
$event->add_link("Board Admin", make_link("admin"));
|
||||
}
|
||||
}
|
||||
@ -90,7 +90,7 @@ class AdminPage extends Extension {
|
||||
|
||||
public function onPostListBuilding(PostListBuildingEvent $event) {
|
||||
global $user;
|
||||
if($user->is_admin() && !empty($event->search_terms)) {
|
||||
if($user->can("manage_admintools") && !empty($event->search_terms)) {
|
||||
$this->theme->display_dbq(implode(" ", $event->search_terms));
|
||||
}
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ class ImageBan extends Extension {
|
||||
global $config, $database, $page, $user;
|
||||
|
||||
if($event->page_matches("image_hash_ban")) {
|
||||
if($user->is_admin()) {
|
||||
if($user->can("ban_image")) {
|
||||
if($event->get_arg(0) == "dnp") {
|
||||
$image = Image::by_id(int_escape($event->get_arg(1)));
|
||||
if($image) {
|
||||
@ -105,7 +105,7 @@ class ImageBan extends Extension {
|
||||
|
||||
public function onUserBlockBuilding(UserBlockBuildingEvent $event) {
|
||||
global $user;
|
||||
if($user->is_admin()) {
|
||||
if($user->can("ban_image")) {
|
||||
$event->add_link("Image Bans", make_link("image_hash_ban/list/1"));
|
||||
}
|
||||
}
|
||||
@ -120,7 +120,7 @@ class ImageBan extends Extension {
|
||||
|
||||
public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event) {
|
||||
global $user;
|
||||
if($user->is_admin()) {
|
||||
if($user->can("ban_image")) {
|
||||
$event->add_part($this->theme->get_buttons_html($event->image));
|
||||
}
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ class IPBan extends Extension {
|
||||
|
||||
public function onUserBlockBuilding(UserBlockBuildingEvent $event) {
|
||||
global $user;
|
||||
if($user->is_admin()) {
|
||||
if($user->can("ban_ip")) {
|
||||
$event->add_link("IP Bans", make_link("ip_ban/list"));
|
||||
}
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ class LogDatabase extends Extension {
|
||||
public function onPageRequest(PageRequestEvent $event) {
|
||||
global $database, $user;
|
||||
if($event->page_matches("log/view")) {
|
||||
if($user->is_admin()) {
|
||||
if($user->can("view_eventlog")) {
|
||||
$wheres = array();
|
||||
$args = array();
|
||||
$page_num = int_escape($event->get_arg(0));
|
||||
@ -111,7 +111,7 @@ class LogDatabase extends Extension {
|
||||
|
||||
public function onUserBlockBuilding(UserBlockBuildingEvent $event) {
|
||||
global $user;
|
||||
if($user->is_admin()) {
|
||||
if($user->can("view_eventlog")) {
|
||||
$event->add_link("Event Log", make_link("log/view"));
|
||||
}
|
||||
}
|
||||
|
@ -65,6 +65,10 @@ new UserClass("base", null, array(
|
||||
"edit_image_lock" => False,
|
||||
"delete_image" => False,
|
||||
|
||||
"ban_image" => False,
|
||||
|
||||
"view_eventlog" => False,
|
||||
|
||||
"create_image_report" => False,
|
||||
"view_image_report" => False, # deal with reported images
|
||||
|
||||
@ -73,6 +77,8 @@ new UserClass("base", null, array(
|
||||
|
||||
"manage_blocks" => False,
|
||||
|
||||
"manage_admintools" => False,
|
||||
|
||||
"protected" => False, # only admins can modify protected users (stops a moderator changing an admin's password)
|
||||
));
|
||||
|
||||
@ -100,6 +106,7 @@ new UserClass("admin", "base", array(
|
||||
"delete_user" => True,
|
||||
"create_image" => True,
|
||||
"delete_image" => True,
|
||||
"ban_image" => True,
|
||||
"create_comment" => True,
|
||||
"delete_comment" => True,
|
||||
"replace_image" => True,
|
||||
@ -113,7 +120,9 @@ new UserClass("admin", "base", array(
|
||||
"view_image_report" => True,
|
||||
"edit_wiki_page" => True,
|
||||
"delete_wiki_page" => True,
|
||||
"view_eventlog" => True,
|
||||
"manage_blocks" => True,
|
||||
"manage_admintools" => True,
|
||||
"protected" => True,
|
||||
));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user