View Source ZoonkWeb.Privacy (Zoonk v0.1.0-alpha)

Privacy configuration.

Link to this section Summary

Functions

Returns the localized label from a list of privacy actions.

Returns the localized label from a list of privacy group keys.

Returns the list of unauthorized privacy groups and their labels.

Link to this section Functions

Link to this function

privacy_action_labels!(groups)

View Source
@spec privacy_action_labels!([atom()]) :: [String.t()]

Returns the localized label from a list of privacy actions.

examples

Examples

iex> privacy_action_labels!([:login_account, :contact_by_manager])
["Allow to log in into your account", "Allow school managers to contact you"]

iex> privacy_action_labels!([:invalid])
** (KeyError) key :invalid not found in:
Link to this function

privacy_group_labels!(groups)

View Source
@spec privacy_group_labels!([atom()]) :: [String.t()]

Returns the localized label from a list of privacy group keys.

examples

Examples

iex> privacy_group_labels!([:school_managers, :teachers])
["School managers", "Teachers"]

iex> privacy_group_labels!([:invalid])
** (KeyError) key :invalid not found in:
Link to this function

unauthorized_group_labels!(authorized)

View Source
@spec unauthorized_group_labels!([atom()]) :: [String.t()]

Returns the list of unauthorized privacy groups and their labels.

This list is based on the list of authorized groups. It returns all groups that aren't listed as authorized.

examples

Examples

iex> unauthorized_group_labels!([:school_managers, :teachers])
["Students from your school", "Students from other schools", ...]

iex> unauthorized_group_labels!([:invalid])
** (KeyError) key :invalid not found in: