Browse Source

fixed 流水线没有查看组织的权限

pull/348/head^2^2
xxq250 1 year ago
parent
commit
2a0d4d6f45
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      app/controllers/api/pm/pipelines_controller.rb

+ 3
- 1
app/controllers/api/pm/pipelines_controller.rb View File

@@ -1,10 +1,12 @@
class Api::Pm::PipelinesController < Api::Pm::BaseController
include RepositoriesHelper
before_action :require_operate_above, except: [:upload_results, :run_results]

def index
@owner = Owner.find_by(login: params[:owner_id].to_s) || Owner.find_by(id: params[:owner_id].to_s)
tip_exception('组织未找到') if @owner.blank?
unless @owner.is_a?(Organization) && @owner.is_member?(current_user.id)
tip_exception('没有查看组织的权限')
end
@project_ids = @owner.projects.ids
project_gpids = @owner.projects.pluck(:gpid)
action_runs = Gitea::ActionRun.where(owner_id: @owner.gitea_uid)


Loading…
Cancel
Save