From 3062528fb0745b5b0b07cd15d1a3c26678dab2b9 Mon Sep 17 00:00:00 2001 From: "sylor_huang@126.com" Date: Wed, 14 Oct 2020 17:12:21 +0800 Subject: [PATCH] change --- app/helpers/api_index_helper.rb | 2 +- app/services/forum_sections_service.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/api_index_helper.rb b/app/helpers/api_index_helper.rb index da6b25c5..3abd1802 100644 --- a/app/helpers/api_index_helper.rb +++ b/app/helpers/api_index_helper.rb @@ -192,7 +192,7 @@ module ApiIndexHelper else user_forum_moder = false end - permission_user = (current_user.admin? || current_user.admin_permission?('forum_post') || user_forum_moder) + permission_user = (current_user.admin? || user_forum_moder) else permission_user = false end diff --git a/app/services/forum_sections_service.rb b/app/services/forum_sections_service.rb index a8bb4a7d..fdfb14ac 100644 --- a/app/services/forum_sections_service.rb +++ b/app/services/forum_sections_service.rb @@ -561,7 +561,7 @@ class ForumSectionsService else parent_section_id = forum_id end - check_user_permission = (current_user.admin? || ForumModerator.where(forum_section_id: parent_section_id, user_id: current_user.id) || current_user.admin_permission?('forum_post')) + check_user_permission = (current_user.admin? || ForumModerator.where(forum_section_id: parent_section_id, user_id: current_user.id)) end check_user_permission