Create a permissions bit in absolute notation (octal).

    The user, group and other parameters are tuples representing Read, Write and Execute values.
    All are set disallowed (set to false) by default and can be individually permitted.

    :param user: User permissions
    :param group: Group permissions
    :param other: Other permissions
    :return: Permissions bit

def make_octal_permissions_mode(user=(False, False, False), group=(False, False, False), other=(False, False, False)):
    """
    Create a permissions bit in absolute notation (octal).

    The user, group and other parameters are tuples representing Read, Write and Execute values.
    All are set disallowed (set to false) by default and can be individually permitted.

    :param user: User permissions
    :param group: Group permissions
    :param other: Other permissions
    :return: Permissions bit
    """
    # Create single digit code for each name
    mode = ''
    for name in (user, group, other):
        read, write, execute = name

        # Execute
        if execute and not all(i for i in (read, write)):
            code = 1

        # Write
        elif write and not all(i for i in (read, execute)):
            code = 2

        # Write & Execute
        elif all(i for i in (write, execute)) and not read:
            code = 3

        # Read
        elif read and not all(i for i in (write, execute)):
            code = 4

        # Read & Execute
        elif all(i for i in (read, execute)) and not write:
            code = 5

        # Read & Write
        elif all(i for i in (read, write)) and not execute:
            code = 6

        # Read, Write & Execute
        elif all(i for i in (read, write, execute)):
            code = 7
        else:
            code = 0
        mode += str(code)
    return int(mode)