forked from Gitlink/forgeplus
ADD 更改工作流的权限
This commit is contained in:
parent
6df01dead1
commit
5156450eac
|
@ -18,8 +18,8 @@ class Ci::BaseController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
def authorize_manage_builds!
|
||||
unless @project.owner?(current_user)
|
||||
def authenticate_manager!
|
||||
unless @project.manager?(current_user)
|
||||
return render_forbidden
|
||||
end
|
||||
end
|
||||
|
@ -28,7 +28,7 @@ class Ci::BaseController < ApplicationController
|
|||
return render_forbidden unless current_user.admin?
|
||||
end
|
||||
|
||||
def authorize_owner_project!
|
||||
def authorize_owner!
|
||||
unless @project.owner?(current_user)
|
||||
return render_forbidden
|
||||
end
|
||||
|
|
|
@ -2,7 +2,7 @@ class Ci::BuildsController < Ci::BaseController
|
|||
include RepositoriesHelper
|
||||
|
||||
before_action :load_project
|
||||
before_action :authorize_owner_project!
|
||||
before_action :authorize_owner!, only: [:restart, :stop]
|
||||
before_action :load_repo
|
||||
before_action :find_cloud_account, except: [:index, :show]
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ class Ci::CloudAccountsController < Ci::BaseController
|
|||
|
||||
skip_before_action :connect_to_ci_database, only: %i[create bind]
|
||||
before_action :load_project, only: %i[create activate]
|
||||
before_action :authorize_owner_project!, only: %i[create activate]
|
||||
before_action :authorize_owner!, only: %i[create activate]
|
||||
before_action :load_repo, only: %i[activate]
|
||||
before_action :find_cloud_account, only: %i[show oauth_grant]
|
||||
before_action :validate_params!, only: %i[create bind]
|
||||
|
|
|
@ -4,7 +4,7 @@ class Ci::ProjectsController < Ci::BaseController
|
|||
|
||||
before_action :load_project
|
||||
before_action :load_repo, only: [:update_trustie_pipeline, :activate, :deactivate]
|
||||
before_action :authorize_owner_project!, only: [:authorize]
|
||||
before_action :authorize_owner!, only: [:authorize]
|
||||
before_action :find_cloud_account, only: [:authorize, :activate, :deactivate]
|
||||
|
||||
def authorize
|
||||
|
|
|
@ -2,7 +2,6 @@ json.step current_user.devops_step
|
|||
json.cloud_account do
|
||||
if @cloud_account && !current_user.devops_uninit?
|
||||
json.ip @cloud_account.drone_ip
|
||||
json.redirect_url "#{@cloud_account.drone_url}/login" if current_user.devops_unverified?
|
||||
else
|
||||
json.nil!
|
||||
end
|
||||
|
|
|
@ -3,7 +3,6 @@ json.ci_certification current_user.ci_certification?
|
|||
json.cloud_account do
|
||||
if @cloud_account && !current_user.devops_uninit?
|
||||
json.ip @cloud_account.drone_ip
|
||||
json.redirect_url "#{@cloud_account.drone_url}/login" if current_user.devops_unverified?
|
||||
else
|
||||
json.nil!
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue