mirror of
				https://github.com/discourse/discourse.git
				synced 2025-02-25 18:55:32 -06:00 
			
		
		
		
	FEATURE: Update upload security status on post move, topic conversion, category change (#8731)
Add TopicUploadSecurityManager to handle post moves. When a post moves around or a topic changes between categories and public/private message status the uploads connected to posts in the topic need to have their secure status updated, depending on the security context the topic now lives in.
This commit is contained in:
		@@ -235,8 +235,11 @@ class Upload < ActiveRecord::Base
 | 
			
		||||
    return false if self.for_theme || self.for_site_setting
 | 
			
		||||
    mark_secure = secure_override_value.nil? ? UploadSecurity.new(self).should_be_secure? : secure_override_value
 | 
			
		||||
 | 
			
		||||
    secure_status_did_change = self.secure? != mark_secure
 | 
			
		||||
    self.update_column("secure", mark_secure)
 | 
			
		||||
    Discourse.store.update_upload_ACL(self) if Discourse.store.external?
 | 
			
		||||
 | 
			
		||||
    secure_status_did_change
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def self.migrate_to_new_scheme(limit: nil)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user