fix: mirror project permission error

This commit is contained in:
2021-04-29 17:36:36 +08:00
parent b673747475
commit fffe57a211
7 changed files with 29 additions and 13 deletions

View File

@@ -0,0 +1,8 @@
namespace :sync_org_project_permission do
desc "sync organization project team permissions"
task mirror: :environment do
Project.mirror.includes(:team_projects,:owner).where(team_projects: {id: nil}, users: {type: 'Organization'}).find_each do |project|
project.set_owner_permission(nil)
end
end
end