mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-20 11:45:57 +08:00
fix: mirror project permission error
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
class Projects::MigrateService < ApplicationService
|
||||
attr_reader :user, :params
|
||||
attr_accessor :project
|
||||
|
||||
def initialize(user, params)
|
||||
@user = user
|
||||
@@ -11,6 +12,7 @@ class Projects::MigrateService < ApplicationService
|
||||
if @project.save!
|
||||
ProjectUnit.init_types(@project.id)
|
||||
Project.update_mirror_projects_count!
|
||||
@project.set_owner_permission(user)
|
||||
Repositories::MigrateService.new(user, @project, repository_params).call
|
||||
else
|
||||
#
|
||||
|
||||
@@ -33,9 +33,8 @@ class Projects::TransferService < ApplicationService
|
||||
|
||||
def update_visit_teams
|
||||
if new_owner.is_a?(Organization)
|
||||
new_owner.teams.where(includes_all_project: true).each do |team|
|
||||
TeamProject.build(new_owner.id, team.id, project.id)
|
||||
end
|
||||
# 为包含组织所有项目的团队创建项目访问权限
|
||||
new_owner.build_permit_team_projects(project.id)
|
||||
else
|
||||
project.team_projects.each(&:destroy!)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user