def check_access_and_print_warning(sock_dir):
    if (os.access(sock_dir, os.R_OK) and
            os.access(sock_dir, os.W_OK) and
            os.access(sock_dir, os.X_OK)):
        return
    else:
        print('WARNING: Events will not be reported'
              ' (not able to access {0})'.format(sock_dir))
Check if this user is able to access the socket
dataset/ETHPy150Open saltstack/salt/tests/eventlisten.py/check_access_and_print_warning