int check_permissions(char *perm, char *req) {
    char p[3];
    p[0] = req[0];
    p[1] = req[1];
    p[2] = req[2];

    for (int i ; i < 3; i++) {
        // handle r
        if (p[0] == perm[i*3]) {p[0] = '-';}
        else if (i < 2) {p[0] = req[(i+1)*3];}
        // handle w
        if (p[1] == perm[i*3 + 1]) {p[1] = '-';}
        else if (i < 2) {p[0] = req[(i+1)*3 + 1];}
        // handle x
        if (p[2] == perm[i*3 + 2]) {p[2] = '-';}
        else if (i < 2) {p[0] = req[(i+1)*2 + 2];}
        // check if permissions are all meet
        if (p[0] == '-' && p[1] == '-' && p[2] == '-') {
            return 0;
        }
    }
    return 1;
};