From f163ce650e6709bada7ee71502df9387b04ba9fd Mon Sep 17 00:00:00 2001 From: Giraffaman Date: Sun, 25 Feb 2024 02:32:30 +0100 Subject: [PATCH] no point in introducing extra permission if we can just use rating "ACLs" --- core/permissions.php | 1 - ext/rating/main.php | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/core/permissions.php b/core/permissions.php index bf5fa56dc..a4123099a 100644 --- a/core/permissions.php +++ b/core/permissions.php @@ -139,5 +139,4 @@ abstract class Permissions public const BULK_EXPORT = "bulk_export"; public const BULK_DOWNLOAD = "bulk_download"; public const BULK_PARENT_CHILD = "bulk_parent_child"; - public const VIEW_NSFW_RATING = "view_nsfw_rating"; } diff --git a/ext/rating/main.php b/ext/rating/main.php index 066dfec59..9883b3f3a 100644 --- a/ext/rating/main.php +++ b/ext/rating/main.php @@ -406,7 +406,7 @@ public function onPageRequest(PageRequestEvent $event): void # TODO: put this into its own extension so we don't touch Ratings if(($event->page_matches("rating/save_ratingView")) || ($event->page_matches("save_ratingView"))) { #if (!$user->can(Permissions::BULK_EDIT_IMAGE_RATING)) { - if (!$user->can(Permissions::VIEW_NSFW_RATING)) { + if(! ((in_array("e", $this->get_user_class_privs($user))) || (in_array("?", $this->get_user_class_privs($user))))) throw new PermissionDenied("Permission denied"); } else { error_log("can save rating...");