mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-24 05:35:46 +08:00
ADD 更改工作流的权限
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user