|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
class IssuesController < ApplicationController
|
|
|
|
|
before_action :require_login, except: [:index, :show]
|
|
|
|
|
before_action :set_project
|
|
|
|
|
before_action :find_project
|
|
|
|
|
before_action :set_user
|
|
|
|
|
before_action :check_project_public, only: [:index ,:show, :copy, :index_chosen, :close_issue]
|
|
|
|
|
before_action :check_issue_permission, except: [:index, :show, :index_chosen]
|
|
|
|
|
before_action :set_issue, only: [:edit, :update, :destroy, :show, :copy, :index_chosen, :close_issue, :lock_issue]
|
|
|
|
@ -341,10 +342,8 @@ class IssuesController < ApplicationController
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
private
|
|
|
|
|
def set_project
|
|
|
|
|
@project = Project.find_by_id(params[:project_id])
|
|
|
|
|
def set_user
|
|
|
|
|
@user = @project.owner
|
|
|
|
|
normal_status(-1, "项目不存在") unless @project.present?
|
|
|
|
|
normal_status(-1, "用户不存在") unless @user.present?
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|