- q = ActiveRecord::Base.connection.exec_query %{
-select uuid from groups limit 1
-}
-
- # 1) any group not group_class != project becomes a 'role' (both empty and invalid groups)
- ActiveRecord::Base.connection.exec_query %{
-UPDATE groups set group_class='role' where group_class != 'project' or group_class is null
- }
-
- Group.where("group_class='role' and owner_uuid != '#{system_user_uuid}'").each do |g|
- # 2) Ownership of a role becomes a can_manage link
- Link.create!(link_class: 'permission',
- name: 'can_manage',
- tail_uuid: g.owner_uuid,
- head_uuid: g.uuid)
+ Group.where("group_class != 'project' or group_class is null").each do |g|
+ # 1) any group not group_class != project becomes a 'role' (both empty and invalid groups)
+ old_owner = g.owner_uuid