Fixed access to BuildList

This commit is contained in:
George Vinogradov 2011-11-03 02:13:58 +04:00
parent aa97eb1863
commit 910446954c
1 changed files with 3 additions and 1 deletions

View File

@ -5,7 +5,7 @@ class BuildListsController < ApplicationController
before_filter :find_arches, :only => [:index, :filter, :all] before_filter :find_arches, :only => [:index, :filter, :all]
before_filter :find_project_versions, :only => [:index, :filter] before_filter :find_project_versions, :only => [:index, :filter]
before_filter :find_build_list_by_bs, :only => [:status_build, :pre_build, :post_build] before_filter :find_build_list_by_bs, :only => [:status_build, :pre_build, :post_build]
before_filter :check_global_access, :except => [:status_build, :post_build, :pre_build, :circle_build, :new_bbdt, :show] before_filter :check_global_access, :except => [:status_build, :post_build, :pre_build, :circle_build, :new_bbdt, :show, :publish, :cancel]
def all def all
if params[:filter] if params[:filter]
@ -25,6 +25,7 @@ class BuildListsController < ApplicationController
def cancel def cancel
build_list = BuildList.find(params[:id]) build_list = BuildList.find(params[:id])
can_perform? build_list.project if build_list
if build_list.delete_build_list if build_list.delete_build_list
redirect_to :back, :notice => t('layout.build_lists.cancel_successed') redirect_to :back, :notice => t('layout.build_lists.cancel_successed')
else else
@ -53,6 +54,7 @@ class BuildListsController < ApplicationController
end end
def publish def publish
can_perform? @project if @project
@build_list = @project.build_lists.find(params[:id]) @build_list = @project.build_lists.find(params[:id])
@build_list.publish @build_list.publish