Skip to main content

groups_for_user

Authorize a user based on groups

def groups_for_user(
environ: dict,
username: string
) - > array

Authorize a user based on groups

Parameters

NameTypeDescription
environdictThe WSGI environment dictionary containing request metadata
usernamestringThe natural key identifier used to look up the user in the database

Returns

TypeDescription
arrayA list of byte-encoded group names associated with the user, or an empty list if the user is inactive or does not exist