Browse Source
			
			
			Check that the client is not updating an outdated cipher, that should be part of an org now
			
			
				pull/343/head
			
			
		 
		
			
				
					
						 Daniel García
					
					7 years ago
						Daniel García
					
					7 years ago
					
				 
				
			 
		 
		
			
				
					
					No known key found for this signature in database
					
						
							GPG Key ID: FC8A7D14C3CD543A
						
					
				
			
		
		
		
	
		
			
				 1 changed files with 
4 additions and 
0 deletions
			 
			
		 
		
			
				- 
					
					
					 
					src/api/core/ciphers.rs
				
				
				
					
						
							
								
									
	
		
		
			
				
					|  | @ -221,6 +221,10 @@ pub fn update_cipher_from_data( | 
			
		
	
		
		
			
				
					|  |  |     nt: &Notify, |  |  |     nt: &Notify, | 
			
		
	
		
		
			
				
					|  |  |     ut: UpdateType, |  |  |     ut: UpdateType, | 
			
		
	
		
		
			
				
					|  |  | ) -> EmptyResult { |  |  | ) -> EmptyResult { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |     if cipher.organization_uuid.is_some() && data.OrganizationId.is_none() { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |         err!("Organization mismatch. Please resync the client before updating the cipher") | 
			
		
	
		
		
			
				
					|  |  |  |  |  |     } | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |     if let Some(org_id) = data.OrganizationId { |  |  |     if let Some(org_id) = data.OrganizationId { | 
			
		
	
		
		
			
				
					|  |  |         match UserOrganization::find_by_user_and_org(&headers.user.uuid, &org_id, &conn) { |  |  |         match UserOrganization::find_by_user_and_org(&headers.user.uuid, &org_id, &conn) { | 
			
		
	
		
		
			
				
					|  |  |             None => err!("You don't have permission to add item to organization"), |  |  |             None => err!("You don't have permission to add item to organization"), | 
			
		
	
	
		
		
			
				
					|  | 
 |