From a820dd0a67da819a28441f2ffd451d3b654fecbe Mon Sep 17 00:00:00 2001 From: jasder Date: Mon, 1 Jul 2019 15:10:24 +0800 Subject: [PATCH] FIX bug --- app/controllers/commons_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/commons_controller.rb b/app/controllers/commons_controller.rb index 105cbefbe..1f6dce053 100644 --- a/app/controllers/commons_controller.rb +++ b/app/controllers/commons_controller.rb @@ -45,7 +45,7 @@ class CommonsController < ApplicationController code = case params[:object_type].strip when 'message' - if current_user.course_identity(@object.board.course) >= 5 || @object.author != current_user + if current_user.course_identity(@object.board.course) >= 5 && @object.author != current_user 403 else 200 @@ -53,7 +53,7 @@ class CommonsController < ApplicationController else current_user.admin? ? 200 : 403 end - return normal_status(403, "你没有权限操作!") if code == 403 + return normal_status(code, "你没有权限操作!") if code == 403 end def action(flag)