more perms

This commit is contained in:
Shish
2012-03-31 12:28:34 +01:00
parent f7f70b8600
commit 7ef52c853f
7 changed files with 22 additions and 11 deletions

View File

@ -38,7 +38,7 @@ class NumericScore extends Extension {
public function onUserPageBuilding(UserPageBuildingEvent $event) {
global $page, $user;
if($user->is_admin()) {
if($user->can("edit_other_votes")) {
$html = $this->theme->get_nuller_html($event->display_user);
$page->add_block(new Block("Votes", $html, "main", 60));
}
@ -79,7 +79,7 @@ class NumericScore extends Extension {
}
}
if($event->page_matches("numeric_score/remove_votes_on") && $user->check_auth_token()) {
if($user->is_admin()) {
if($user->can("edit_other_vote")) {
$image_id = int_escape($_POST['image_id']);
$database->execute(
"DELETE FROM numeric_score_votes WHERE image_id=?",
@ -92,7 +92,7 @@ class NumericScore extends Extension {
}
}
if($event->page_matches("numeric_score/remove_votes_by") && $user->check_auth_token()) {
if($user->is_admin()) {
if($user->can("edit_other_vote")) {
$this->delete_votes_by(int_escape($_POST['user_id']));
$page->set_mode("redirect");
$page->set_redirect(make_link());