game锁定权限控制
This commit is contained in:
parent
6a77410d80
commit
8c99bc495a
|
@ -6,6 +6,7 @@ class GamesController < ApplicationController
|
|||
before_filter :find_game, :only => [:show, :game_build, :entry,:next_step, :outputs_show, :file_edit, :file_update, :game_status, :change_status]
|
||||
before_filter :find_repository, :only => [:show, :entry, :file_edit, :file_update]
|
||||
before_filter :allowd_manager
|
||||
before_filter :allowd_view, :only => [:show, :game_build, :next_step, :change_status, :file_update]
|
||||
include ApplicationHelper
|
||||
|
||||
def index
|
||||
|
@ -211,6 +212,11 @@ class GamesController < ApplicationController
|
|||
render_403 unless (User.current.manager_of_myshixun?(@myshixun) || User.current.admin? || User.current.id == @myshixun.shixun.try(:user_id))
|
||||
end
|
||||
|
||||
# 判断成员是否允许查看
|
||||
def allowd_view
|
||||
render_403 if @game.status == 3
|
||||
end
|
||||
|
||||
# Find myshixun of id params[:id]
|
||||
def find_myshixun
|
||||
myshixun_id = params[:myshixun_id] || (params[:game] && params[:game][:myshixun_id])
|
||||
|
|
Loading…
Reference in New Issue