()
return granted_privs_for_grantee
Builds a dictionary where each grantee_slug contains a set of privilege slugs that have been granted
    :return: {<grantee_slug>: {<priv_slug>, <priv_slug>}, ... }
Builds a dictionary where each grantee_slug contains a set of privilege slugs that have been granted
    :return: {<grantee_slug>: {<priv_slug>, <priv_slug>}, ... }
Builds a dictionary where each grantee_slug contains a set of privilege slugs that have been granted : return : { <grantee_slug > : { <priv_slug > <priv_slug > } ... }
def get_granted_privs_for_grantee():
    """
    Builds a dictionary where each grantee_slug contains a set of privilege slugs that have been granted
    :return: {<grantee_slug>: {<priv_slug>, <priv_slug>}, ... }
    """
    granted_privs_for_grantee = defaultdict(set)
    for grant in Grant.objects.select_related('from_role', 'to_role').all():
        granted_privs_for_grantee[grant.from_role.slug].add(grant.to_role.slug)

    return granted_privs_for_grantee
def get_granted_privs_for_grantee ( ) : granted_privs_for_grantee = defaultdict ( set ) for grant in Grant . objects . select_related ( 'from_role' , 'to_role' ) . all ( ) : granted_privs_for_grantee [ grant . from_role . slug ] . add ( grant . to_role . slug ) return granted_privs_for_grantee