Skip to content

6.2.2.5 OrganizationRoleAccessControl

6.2.2.5.1 Purpose

A named bundle of capabilities that can be given to the users of any Organization. Roles are global and maintained by Moonitoring administrators; their priority decides which roles a user may assign to others. Each role says which types of Organization offer it and which can receive it through a delegation, so a farm offers Technician and an insurer Analyst, from one catalog of capabilities.

6.2.2.5.2 Questions it answers

  • What can a holder of this role do?
  • Which roles may a user assign, given their own role?
  • In which order are roles listed?
  • Which types of Organization offer the role, and which receive it by delegation?

6.2.2.5.3 Fields

Field Type Cardinality Description
id string (uuid) 1..1 Key.
name string 1..1 Unique.
capabilities OrganizationRoleCapabilityEnum 0..*
priority integer 1..1 Higher value = higher priority = higher permissions; also used for ordering.
A user gives, changes or revokes a role, directly, through a group, an invitation, a join link or a delegation, only if their own role outranks it by priority and holds every capability in it: nobody grants more than they have.
Nobody acts on themselves: a user cannot give, change or revoke their own memberships, nor those of a role they hold.
system_version SystemVersion 1..1 A change of capabilities keeps the previous image, so what a role allowed at any past write is known.
key OrganizationPredefinedRoleEnum 0..1 Unique.
The stable key of a predefined role. Systems find a role by its key, never by its name, which can be translated or renamed; empty for a role that is not predefined.
organization_types set of enum 1..* Values: Farm, Cooperative, Insurer, Professional.
The types of Organization that offer the role: it is given directly, through a group, an invitation, a join link or to a ServiceAccount only in an Organization of one of these types. access sets it for a predefined role from the lists of Organization. Capabilities stay one catalog (OrganizationRoleCapabilityEnum), the same in every type: a capability on farm data acts only in a Farm, and access.cooperative_constraints.manage and access.cooperative_members.read only in a Cooperative.
delegatee_types set of enum 0..* Values: Cooperative, Insurer, Professional.
The types of Organization that can receive the role through a delegation, never a Farm; empty for a role that is never delegated: Owner, Sync Client and every role with an admin capability (OrganizationDelegationMembership.role).
Access sets it for a predefined role from the lists of Organization.
created_at datetime 1..1
updated_at datetime 1..1

6.2.2.5.4 Relationships

Referenced by

Uses types

OrganizationRoleCapabilityEnum, SystemVersion, OrganizationPredefinedRoleEnum

6.2.2.5.5 Rules & constraints

  • Roles are global: the same in every Organization, maintained by staff with access.organization_roles.manage.
  • The predefined roles (OrganizationPredefinedRoleEnum) each have a stable key and an explicit list of capabilities, never every capability a system publishes: a new capability enters a role only by a decision.
  • The access system creates the predefined roles with the capabilities of OrganizationPredefinedRoleEnum when they are missing and never overwrites them. Owner and Sync Client are system roles: no operation changes them, only a release of access. Staff with access.organization_roles.manage can change the other roles, and the change reaches every Organization at once.

Open questions

Custom roles of an Organization, chosen from the catalog under the same rules, are an open decision (D24); until then every role is global.