Browse Source
			
			
			Merge pull request #988 from theycallmesteve/rename_functions
			
				Rename functions
			
			
				pull/998/head
			
			
		 
		
			
				
					
						
						Daniel García
					
					6 years ago
					
						
							committed by
							
								
								GitHub
							
						 
					
				 
				
			 
		 
		
			
				
					
					No known key found for this signature in database
					
						
							GPG Key ID: 4AEE18F83AFDEB23
						
					
				
			
		
		
		
	
		
			
				 4 changed files with 
4 additions and 
4 deletions
			 
			
		 
		
			
				- 
					
					
					 
					src/api/core/organizations.rs
				
 
			
				- 
					
					
					 
					src/api/core/two_factor/mod.rs
				
 
			
				- 
					
					
					 
					src/db/models/organization.rs
				
 
			
				- 
					
					
					 
					src/db/models/two_factor.rs
				
 
			
		
		
			
			
			
			
			
			
				
				
					
						
							
								
									
	
		
			
				
					| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -374,7 +374,7 @@ fn get_collection_users(org_id: String, coll_id: String, _headers: AdminHeaders, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        .map(|col_user| { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            UserOrganization::find_by_user_and_org(&col_user.user_uuid, &org_id, &conn) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                .unwrap() | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                .to_json_collection_user_details(col_user.read_only) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                .to_json_read_only(col_user.read_only) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        }) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        .collect(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				
					
  | 
				
			
			
		
	
								
							
						
					 
					
				 
			 
		
			
			
			
			
			
			
				
				
					
						
							
								
									
	
		
			
				
					| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -38,7 +38,7 @@ pub fn routes() -> Vec<Route> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					#[get("/two-factor")] | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					fn get_twofactor(headers: Headers, conn: DbConn) -> JsonResult { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    let twofactors = TwoFactor::find_by_user(&headers.user.uuid, &conn); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    let twofactors_json: Vec<Value> = twofactors.iter().map(TwoFactor::to_json_list).collect(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    let twofactors_json: Vec<Value> = twofactors.iter().map(TwoFactor::to_json_provider).collect(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    Ok(Json(json!({ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        "Data": twofactors_json, | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				
					
  | 
				
			
			
		
	
								
							
						
					 
					
				 
			 
		
			
			
			
			
			
			
				
				
					
						
							
								
									
	
		
			
				
					| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -304,7 +304,7 @@ impl UserOrganization { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        }) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    pub fn to_json_collection_user_details(&self, read_only: bool) -> Value { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    pub fn to_json_read_only(&self, read_only: bool) -> Value { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        json!({ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            "Id": self.uuid, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            "ReadOnly": read_only | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				
					
  | 
				
			
			
		
	
								
							
						
					 
					
				 
			 
		
			
			
			
			
			
			
				
				
					
						
							
								
									
	
		
			
				
					| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -59,7 +59,7 @@ impl TwoFactor { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        }) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    pub fn to_json_list(&self) -> Value { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    pub fn to_json_provider(&self) -> Value { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        json!({ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            "Enabled": self.enabled, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            "Type": self.atype, | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				
					
  |