mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-26 09:42:46 +08:00
Fix permission migration (#3465)
This commit is contained in:
parent
67f4e81a3a
commit
1565b4bbfb
1 changed files with 10 additions and 0 deletions
|
@ -54,6 +54,16 @@ class MigrateToNewUserRoles < ActiveRecord::Migration[6.1]
|
|||
user_assignments << UserAssignment.new(user: user_project.user,
|
||||
assignable: user_project.project,
|
||||
user_role: user_role)
|
||||
user_project.project.experiments.each do |experiment|
|
||||
user_assignments << UserAssignment.new(user: user_project.user,
|
||||
assignable: experiment,
|
||||
user_role: user_role)
|
||||
experiment.my_modules.each do |my_module|
|
||||
user_assignments << UserAssignment.new(user: user_project.user,
|
||||
assignable: my_module,
|
||||
user_role: user_role)
|
||||
end
|
||||
end
|
||||
end
|
||||
UserAssignment.import(user_assignments)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue