update view permission
This commit is contained in:
		
							parent
							
								
									f37f4f2d06
								
							
						
					
					
						commit
						c43bb69a87
					
				| 
						 | 
				
			
			@ -23,16 +23,12 @@ export const checkPermissionAdmin = (permission:string) => {
 | 
			
		|||
  if (user) {
 | 
			
		||||
    const parsedUser = JSON.parse(user)
 | 
			
		||||
    let permissions = parsedUser.user.permission.split(',')
 | 
			
		||||
    permissions.map((p:string)=>{
 | 
			
		||||
      if(permission.includes(p)){
 | 
			
		||||
        return true
 | 
			
		||||
      }
 | 
			
		||||
    })
 | 
			
		||||
    // if (parsedUser.user.permission.includes('admin')) {
 | 
			
		||||
    //   return true
 | 
			
		||||
    // } else {
 | 
			
		||||
    
 | 
			
		||||
    if (permissions.find((p:string)=>permission.includes(p))) {
 | 
			
		||||
      return true
 | 
			
		||||
    } else {
 | 
			
		||||
      return false
 | 
			
		||||
    // }
 | 
			
		||||
    }
 | 
			
		||||
  } else {
 | 
			
		||||
    return false
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue