Update new UI task to migrate the authorizations.
PS: sold must be running for new_ui.rake
This commit is contained in:
		
							parent
							
								
									856898016b
								
							
						
					
					
						commit
						65527017ca
					
				| 
						 | 
					@ -46,6 +46,20 @@ namespace :new_ui do
 | 
				
			||||||
          object.save
 | 
					          object.save
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
 | 
					      if object_auths = ObjectAuth.where(obj_authable_type: "#{category_name.classify}Category")
 | 
				
			||||||
 | 
					        object_auths.each do |object_auth|
 | 
				
			||||||
 | 
					          case object_auth.title
 | 
				
			||||||
 | 
					          when 'fact_check'
 | 
				
			||||||
 | 
					            new_object_auth = new_category.get_object_auth_by_title("approval_#{module_app.key}")
 | 
				
			||||||
 | 
					          else
 | 
				
			||||||
 | 
					            new_object_auth = new_category.get_object_auth_by_title("submit_#{module_app.key}")
 | 
				
			||||||
 | 
					          end
 | 
				
			||||||
 | 
					          object_auth.auth_users.each do |user|
 | 
				
			||||||
 | 
					            new_object_auth.add_user_to_privilege_list(user)
 | 
				
			||||||
 | 
					          end
 | 
				
			||||||
 | 
					          object_auth.destroy
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
 | 
					      end
 | 
				
			||||||
      category.destroy
 | 
					      category.destroy
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue