Proca.Staffer.Role (proca v3.0.2)

For the organisation (they should be exclusive):

  • Campaigner (a normal org member, can add campaigns and action_pages) ๐Ÿคน (person juggling)
  • Mechanic (settings, can add people to the org, use api, etc) [woman mechanic ๐Ÿ‘ฉโ€๐Ÿ”ง]
  • Campaign manager (can add people to the org, sign off, delegate action pages + campaigner) [woman pilot emoji] ๐Ÿ‘ฉโ€โœˆ๏ธ
  • Api (robot emoji, api) ๐Ÿค–

Obviously the permission bits overlap between the roles, so the code must figure out what is the role based on bits set.

Link to this section Summary

Link to this section Functions

Link to this function

add_user_as(user, org, role)

Link to this function

can_assign_role?(auth)

Link to this function

can_assign_role?(auth, role)

Check if current user or staffer has big enough permission to assign a role

Link to this function

change(staffer, role)

Link to this function

findrole(staffer)

Link to this function

findrole(staffer, list)

Link to this function

from_string(rs)

Specs

from_string(String.t()) :: atom() | nil
Link to this function

lesser_equal?(weaker, stronger)

Link to this function

permissions(role)