xpgdiff.py
def grants_for_acl(obj, acl):
    """
    Gets a list of grants (Grant instances) for an ACL string.

    :param obj: The object the ACL applies to.
    :param acl: The ACL as a string.
    :returns: The list of grants.
    """
    if not isinstance(acl, str) or len(acl) <= 2:
        return []
    if acl[0] != '{' or acl[-1] != '}':
        return []
    acls = acl[1:-2].split(',')
    grants = []
    for _acl in acls:
        role_privileges, owner = _acl.split('/')
        role, privilegestr = role_privileges.split('=')
        if role == owner:
            continue
        grants.append(Grant(obj, role if role else 'PUBLIC', privilegestr))
    return grants

    Gets a list of grants (Grant instances) for an ACL string.

    :param obj: The object the ACL applies to.
    :param acl: The ACL as a string.
    :returns: The list of grants.
    
Gets a list of grants (Grant instances) for an ACL string.
Gets a list of grants ( Grant instances ) for an ACL string .
def grants_for_acl(obj, acl):
    if not isinstance(acl, str) or len(acl) <= 2:
        return []
    if acl[0] != '{' or acl[-1] != '}':
        return []
    acls = acl[1:-2].split(',')
    grants = []
    for _acl in acls:
        role_privileges, owner = _acl.split('/')
        role, privilegestr = role_privileges.split('=')
        if role == owner:
            continue
        grants.append(Grant(obj, role if role else 'PUBLIC', privilegestr))
    return grants
def grants_for_acl ( obj , acl ) : if not isinstance ( acl , str ) or len ( acl ) <= 2 : return [ ] if acl [ 0 ] != '{' or acl [ - 1 ] != '}' : return [ ] acls = acl [ 1 : - 2 ] . split ( ',' ) grants = [ ] for _acl in acls : role_privileges , owner = _acl . split ( '/' ) role , privilegestr = role_privileges . split ( '=' ) if role == owner : continue grants . append ( Grant ( obj , role if role else 'PUBLIC' , privilegestr ) ) return grants
Gets a list of grants (Grant instances) for an ACL string.
Gets a list of grants ( Grant instances ) for an ACL string .
"""
    Gets a list of grants (Grant instances) for an ACL string.

    :param obj: The object the ACL applies to.
    :param acl: The ACL as a string.
    :returns: The list of grants.
    """
The list of grants.
The list of grants .
obj
The object the ACL applies to.
The object the ACL applies to .
acl
The ACL as a string.
The ACL as a string .