mirror of
				https://github.com/mealie-recipes/mealie.git
				synced 2025-11-03 10:43:40 -05:00 
			
		
		
		
	
		
			
	
	
		
			12 lines
		
	
	
		
			373 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
		
		
			
		
	
	
			12 lines
		
	
	
		
			373 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| 
								 | 
							
								interface CanOrganizeRedirectParams {
							 | 
						||
| 
								 | 
							
								    $auth: any
							 | 
						||
| 
								 | 
							
								    redirect: (path: string) => void
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								export default function ({ $auth, redirect }: CanOrganizeRedirectParams) {
							 | 
						||
| 
								 | 
							
								    // If the user is not allowed to organize redirect to the home page
							 | 
						||
| 
								 | 
							
								    if (!$auth.user.canOrganize) {
							 | 
						||
| 
								 | 
							
								        console.warn("User is not allowed to organize data");
							 | 
						||
| 
								 | 
							
								        return redirect("/")
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								}
							 |