Skip to main content

Privacera Documentation

With default Value - GET_USER_ATTR_Q(‘attribute_key’,‘default_value’)

Description: returns the list of attributes mapped to the user (with each attribute name in single quotes, separated by comma). If the user does not have an attribute‘attribute_key’, ‘default_value’ will be returned. Can be used for comparison of character values.

Example:

  • The user has an attribute: access=mumbai,GET_USER_ATTR_Q(‘location’,‘NY’) will return‘mumbai’.

  • The user does not have an attribute,GET_USER_ATTR_Q(‘location’,‘NY’) will return‘NY’.

Usage: can be used in:

  • Row Level Filter Policies - row level filters expressions

  • Example:location in (${{GET_USER_ATTR_Q(‘location’,‘NY’)}})

  • Masking policy - Custom masking condition

  • Example:CASE WHEN location in (${{GET_USER_ATTR_Q(‘location’,‘NY’)}}) THEN {col} ELSE 'none' END

  • Policy condition

  • Example:GET_USER_ATTR_Q(‘location’,‘NY’)==’\'mumbai\’'