def check_permissions():
    """
    Checks if current user can access docker
    """
    if (
        not grp.getgrnam('docker').gr_gid in os.getgroups()
        and not os.geteuid() == 0
    ):
        exitStr = """
        User doesn't have permission to use docker.
        You can do either of the following,
        1. Add user to the 'docker' group (preferred)
        2. Run command as superuser using either 'sudo' or 'su -c'
        """
        exit(exitStr)
def check_permissions ( ) : if ( not grp . getgrnam ( 'docker' ) . gr_gid in os . getgroups ( ) and not os . geteuid ( ) == 0 ) : exitStr = """
        User doesn't have permission to use docker.
        You can do either of the following,
        1. Add user to the 'docker' group (preferred)
        2. Run command as superuser using either 'sudo' or 'su -c'
        """ exit ( exitStr )
Checks if current user can access docker