Exemple #1
0
def subtract_(endpoint: str, payload: Dict, rev: int) -> Dict:
    """Subtract user-defined permissions (full path version).

    :param endpoint: Endpoint for permissions.
    :param payload: Payload of user-defined permissions to subtract.
    :param rev: Last revision of the permissions.
    :return: The Nexus metadata of the permissions.
    """
    return http_patch(endpoint, payload, rev=rev)
Exemple #2
0
def subtract(permissions: List[str], rev: int) -> Dict:
    """Subtract user-defined permissions.

    :param permissions: List of user-defined permissions.
    :param rev: Last revision of the permissions.
    :return: The Nexus metadata of the permissions.
    """
    payload = _payload(permissions, "Subtract")
    return http_patch([SEGMENT], payload, rev=rev)
Exemple #3
0
def subtract_(path: str, payload: Dict, rev: int) -> Dict:
    """Subtract ACLs on a full path.

    :param path: Full path on which subtracting ACLs.
    :param payload: Payload of the ACLs to subtract.
    :param rev: Last revision of the ACLs.
    :return: The Nexus metadata of the ACLs.
    """
    return http_patch(path, payload, rev=rev)
Exemple #4
0
def append_(path: str, payload: Dict, rev: int) -> Dict:
    """Append ACLs on a full path.

    :param path: Full path on which appending ACLs.
    :param payload: Payload of the ACLs to append.
    :param rev: Last revision of the ACLs.
    :return: The Nexus metadata of the ACLs.
    """
    return http_patch(path, payload, rev=rev)
Exemple #5
0
def subtract(subpath: str, permissions: List[List[str]],
             identities: List[Dict], rev: int) -> Dict:
    """Subtract ACLs on a subpath.

    `permissions`` and ``identities`` have the same order.

    :param subpath: Subpath on which subtracting ACLs.
    :param permissions: List of list of permissions.
    :param identities: List of identities for which to remove the permissions.
    :param rev: Last revision of the ACLs.
    :return: The Nexus metadata of the ACLs.
    """
    payload = _payload(permissions, identities, "Subtract")
    return http_patch([SEGMENT, subpath], payload, rev=rev)