From 518edeac68696b473de09efecea558d9900a388d Mon Sep 17 00:00:00 2001 From: nwb Date: Tue, 22 Jul 2014 09:15:19 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=96=87=E6=A1=A3=E6=B5=8F?= =?UTF-8?q?=E8=A7=88BUG=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/boards_controller.rb | 2 +- app/controllers/documents_controller.rb | 2 +- app/models/project.rb | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controllers/boards_controller.rb b/app/controllers/boards_controller.rb index a692acc12..40674b53f 100644 --- a/app/controllers/boards_controller.rb +++ b/app/controllers/boards_controller.rb @@ -70,7 +70,7 @@ class BoardsController < ApplicationController @message = Message.new(:board => @board) #modify by nwb if @project - render :action => 'show', :layout => !request.xhr? + render :action => 'show', :layout => 'base_projects' elsif @course render :action => 'show', :layout => 'base_courses' end diff --git a/app/controllers/documents_controller.rb b/app/controllers/documents_controller.rb index 89bd9dc92..7bca47f36 100644 --- a/app/controllers/documents_controller.rb +++ b/app/controllers/documents_controller.rb @@ -105,7 +105,7 @@ class DocumentsController < ApplicationController # 权限判断 # add by nwb def authorize_document - if !(User.current.admin? || User.current.member_of?(@project) || @document.is_public==1) + if !(User.current.admin? || User.current.member_of?(@project) || @document == nil || (@document != nil && @document.is_public==1)) render_403 :message => :notice_not_authorized end end diff --git a/app/models/project.rb b/app/models/project.rb index 5bcd2e8c5..35a360ac3 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -1138,13 +1138,13 @@ class Project < ActiveRecord::Base # 创建项目后在项目下同步创建一个讨论区 def create_board_sync @board = self.boards.build - self.name=" #{l(:label_borad_course) }" + self.name=" #{l(:label_borad_project) }" @board.name = self.name @board.description = self.name.to_s if @board.save - logger.debug "[Course Model] ===> #{@board.to_json}" + logger.debug "[Project Model] ===> #{@board.to_json}" else - logger.error "[Course Model] ===> Auto create board when Course saved, because #{@board.full_messages}" + logger.error "[Project Model] ===> Auto create board when Project saved, because #{@board.full_messages}" end end