diff --git a/data/config.ini b/data/config.ini index 04af9432..2adcee5e 100644 --- a/data/config.ini +++ b/data/config.ini @@ -86,14 +86,11 @@ editPostThumb=moderator editPostSource=moderator editPostRelations.own=registered editPostRelations.all=moderator -editPostFile.all=moderator -editPostFile.own=moderator +editPostFile=moderator massTag.own=registered massTag.all=power-user -hidePost.own=moderator -hidePost.all=moderator -deletePost.own=moderator -deletePost.all=moderator +hidePost=moderator +deletePost=moderator featurePost=moderator scorePost=registered flagPost=registered diff --git a/src/Controllers/PostController.php b/src/Controllers/PostController.php index f0b28a37..55dff495 100644 --- a/src/Controllers/PostController.php +++ b/src/Controllers/PostController.php @@ -254,7 +254,7 @@ class PostController public function flagAction($id) { $post = PostModel::findByIdOrName($id); - PrivilegesHelper::confirmWithException(Privilege::FlagPost); + PrivilegesHelper::confirmWithException(Privilege::FlagPost, PrivilegesHelper::getIdentitySubPrivilege($post->getUploader())); if (InputHelper::get('submit')) { @@ -339,7 +339,7 @@ class PostController public function addFavoriteAction($id) { $post = PostModel::findByIdOrName($id); - PrivilegesHelper::confirmWithException(Privilege::FavoritePost); + PrivilegesHelper::confirmWithException(Privilege::FavoritePost, PrivilegesHelper::getIdentitySubPrivilege($post->getUploader())); if (InputHelper::get('submit')) { @@ -358,7 +358,7 @@ class PostController public function remFavoriteAction($id) { $post = PostModel::findByIdOrName($id); - PrivilegesHelper::confirmWithException(Privilege::FavoritePost); + PrivilegesHelper::confirmWithException(Privilege::FavoritePost, PrivilegesHelper::getIdentitySubPrivilege($post->getUploader())); if (InputHelper::get('submit')) { @@ -379,7 +379,7 @@ class PostController public function scoreAction($id, $score) { $post = PostModel::findByIdOrName($id); - PrivilegesHelper::confirmWithException(Privilege::ScorePost); + PrivilegesHelper::confirmWithException(Privilege::ScorePost, PrivilegesHelper::getIdentitySubPrivilege($post->getUploader())); if (InputHelper::get('submit')) { @@ -399,7 +399,7 @@ class PostController public function featureAction($id) { $post = PostModel::findByIdOrName($id); - PrivilegesHelper::confirmWithException(Privilege::FeaturePost); + PrivilegesHelper::confirmWithException(Privilege::FeaturePost, PrivilegesHelper::getIdentitySubPrivilege($post->getUploader())); PropertyModel::set(PropertyModel::FeaturedPostId, $post->id); PropertyModel::set(PropertyModel::FeaturedPostDate, time()); PropertyModel::set(PropertyModel::FeaturedPostUserName, $this->context->user->name); diff --git a/src/Controllers/UserController.php b/src/Controllers/UserController.php index 3c0924ce..2c6ca8d5 100644 --- a/src/Controllers/UserController.php +++ b/src/Controllers/UserController.php @@ -140,7 +140,7 @@ class UserController public function flagAction($name) { $user = UserModel::findByNameOrEmail($name); - PrivilegesHelper::confirmWithException(Privilege::FlagUser); + PrivilegesHelper::confirmWithException(Privilege::FlagUser, PrivilegesHelper::getIdentitySubPrivilege($user)); if (InputHelper::get('submit')) { diff --git a/src/Views/post-view.phtml b/src/Views/post-view.phtml index c9812aee..b6ab3649 100644 --- a/src/Views/post-view.phtml +++ b/src/Views/post-view.phtml @@ -130,7 +130,7 @@ $canEditAnything = count(array_filter($editPostPrivileges)) > 0; context->transport->post->score ?> - + context->transport->post->getUploader()))): ?>  [ $this->context->transport->post->id, 'score' => $score]); } ?> @@ -173,7 +173,7 @@ $canEditAnything = count(array_filter($editPostPrivileges)) > 0; - + context->transport->post->getUploader()))): ?>
context->favorite): ?> @@ -232,7 +232,7 @@ $canEditAnything = count(array_filter($editPostPrivileges)) > 0; context->transport->post->getUploader()))) { $options []= [ @@ -244,7 +244,7 @@ $canEditAnything = count(array_filter($editPostPrivileges)) > 0; ]; } - if (PrivilegesHelper::confirm(Privilege::FlagPost)) + if (PrivilegesHelper::confirm(Privilege::FlagPost, PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->post->getUploader()))) { if ($this->context->flagged) { diff --git a/src/Views/user-view.phtml b/src/Views/user-view.phtml index eb5ceb5c..e107bebf 100644 --- a/src/Views/user-view.phtml +++ b/src/Views/user-view.phtml @@ -86,7 +86,7 @@ LayoutHelper::addStylesheet('user-view.css'); ]; } - if (PrivilegesHelper::confirm(Privilege::FlagUser)) + if (PrivilegesHelper::confirm(Privilege::FlagUser, PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->user))) { if ($this->context->flagged) {