From f992da84ae2a1efbbe3993dab7608f9e81d08913 Mon Sep 17 00:00:00 2001 From: Alex Cabal Date: Sat, 13 Jan 2024 16:33:57 -0600 Subject: [PATCH] Don't allow submitters to review their own artwork --- config/sql/se/Benefits.sql | 11 ++++++----- lib/Benefits.php | 1 + www/artworks/get.php | 26 ++++++++++++++------------ www/artworks/new.php | 32 ++++++++++++++++++-------------- www/artworks/post.php | 16 ++++++++++++++-- 5 files changed, 53 insertions(+), 33 deletions(-) diff --git a/config/sql/se/Benefits.sql b/config/sql/se/Benefits.sql index 22555f45..1299e466 100644 --- a/config/sql/se/Benefits.sql +++ b/config/sql/se/Benefits.sql @@ -1,10 +1,11 @@ CREATE TABLE `Benefits` ( `UserId` int(10) unsigned NOT NULL, - `CanAccessFeeds` tinyint(1) unsigned NOT NULL, - `CanVote` tinyint(1) unsigned NOT NULL, - `CanBulkDownload` tinyint(1) unsigned NOT NULL, - `CanUploadArtwork` tinyint(1) unsigned NOT NULL, - `CanReviewArtwork` tinyint(1) unsigned NOT NULL, + `CanAccessFeeds` tinyint(1) unsigned NOT NULL DEFAULT 0, + `CanVote` tinyint(1) unsigned NOT NULL DEFAULT 0, + `CanBulkDownload` tinyint(1) unsigned NOT NULL DEFAULT 0, + `CanUploadArtwork` tinyint(1) unsigned NOT NULL DEFAULT 0, + `CanReviewArtwork` tinyint(1) unsigned NOT NULL DEFAULT 0, + `CanReviewOwnArtwork` tinyint(1) unsigned NOT NULL DEFAULT 0, PRIMARY KEY (`UserId`), KEY `idxBenefits` (`CanAccessFeeds`,`CanVote`,`CanBulkDownload`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; diff --git a/lib/Benefits.php b/lib/Benefits.php index 783e0192..7bb8aad4 100644 --- a/lib/Benefits.php +++ b/lib/Benefits.php @@ -5,4 +5,5 @@ class Benefits{ public bool $CanBulkDownload = false; public bool $CanUploadArtwork = false; public bool $CanReviewArtwork = false; + public bool $CanReviewOwnArtwork = false; } diff --git a/www/artworks/get.php b/www/artworks/get.php index 066b2288..8143dee4 100644 --- a/www/artworks/get.php +++ b/www/artworks/get.php @@ -129,21 +129,23 @@ catch(Exceptions\ArtworkNotFoundException){ -

Reviewer options

+

Editor options

Review the metadata and PD proof for this artwork submission. Approve to make it available for future producers.

- + SubmitterUserId != $GLOBALS['User']->UserId) || $GLOBALS['User']->Benefits->CanReviewOwnArtwork){ ?> + + - Benefits->CanReviewArtwork){ ?> +
- Reviewer options - + Editor options + Benefits->CanReviewOwnArtwork){ ?> + +