Skip to content

Commit

Permalink
no point in introducing extra permission if we can just use rating "A…
Browse files Browse the repository at this point in the history
…CLs"
  • Loading branch information
Giraffaman committed Feb 25, 2024
1 parent 516a54e commit f163ce6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion core/permissions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
2 changes: 1 addition & 1 deletion ext/rating/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -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...");
Expand Down

0 comments on commit f163ce6

Please sign in to comment.