
export function permission(value, parent) {
    let permission = window.localStorage.getItem('permission')
    permission = permission.split(',')
    parent = parent ? parent : null
    // if(parent) {
    //     if(permission.includes(value) && permission.includes(parent)) {
    //         return true
    //     } else {
    //         return false
    //     }
    // } else {
    //     if(permission.includes(value)) {
    //         return true
    //     } else {
    //         return false
    //     }
    // }
    if(permission.includes(value) && !parent) {
        return true
    } else if(permission.includes(value) && permission.includes(parent)) {
        return true
    } else {
        return false
    }
    
}