CURRENT_USER_IN_GROUP

Returns a boolean based on whether the current user running the query belongs to a given group. Can be called in two forms using one or two arguments.

ParameterTypeDescription
organization
string
the name of the organization
group_id
string
the id of the group
Returns: string

Example

query:

SELECT animal_type,
       breed,
       age_upon_outcome,
       sex_upon_outcome
  FROM austin_animal_center_age_at_outcome
  WHERE CURRENT_USER_IN_GROUP ("ddw-doccorp/members")
SELECT animal_type,
       breed,
       age_upon_outcome,
       sex_upon_outcome
  FROM austin_animal_center_age_at_outcome
  WHERE CURRENT_USER_IN_GROUP ("ddw-doccorp","members")

results:

animal_type breed age_upon_outcome sex_upon_outcome
Dog Spinone Italiano Mix 6 years Neutered Male
Dog Spinone Italiano Mix 7 years Neutered Male
Dog Miniature Poodle Mix 2 years Neutered Male
Dog West Highland Mix 3 years Spayed Female
Dog Cavalier Span Mix 7 years Intact