def get_user_project_permissions(user, project, cache='user'):
 membership = _get_user_project_membership(user, project, cache=cache)
 is_member = (membership is not None)
 is_admin = (is_member and membership.is_admin)
 return calculate_permissions(is_authenticated=user.is_authenticated(), is_superuser=user.is_superuser, is_member=is_member, is_admin=is_admin, role_permissions=_get_membership_permissions(membership), anon_permissions=project.anon_permissions, public_permissions=project.public_permissions)

def get_user_project_permissions ( user , project , cache = 'user' ) : membership = _get_user_project_membership ( user , project , cache = cache ) is_member = ( membership is not None ) is_admin = ( is_member and membership . is_admin ) return calculate_permissions ( is_authenticated = user . is_authenticated ( ) , is_superuser = user . is_superuser , is_member = is_member , is_admin = is_admin , role_permissions = _get_membership_permissions ( membership ) , anon_permissions = project . anon_permissions , public_permissions = project . public_permissions )
cache param determines how memberships are calculated trying to reuse the existing data in cache .