Skip to content

Settings and access

Settings and help

Settings are values the community's admins see and may change on the install, keyed by setting key, at most 16. A part's text names one as {settings.<key>}, and a declarative plug-in's expressions read them as settings.<key>.

settings: {
  prefix: { type: "string", label: { en: "Reference prefix" }, unique: true, assigned: "community_name" },
},

A unique setting's value is held by no other community on the deployment for this plug-in, and is a lowercase letter, then lowercase letters and digits, 2 to 16 characters in all (^[a-z][a-z0-9]{1,15}$), so a reference such as acme-7 reads one way. With assigned: "community_name", Initiative gives it a value when the community installs the plug-in: the letters and digits of the community's name, in lowercase, with a short random suffix when another community holds that value. An admin may rename it. The earlier values stay the community's, and expressions read them as aliases.<key>, so a reference made under one still resolves.

Help is markdown, by language tag, at most 2000 characters in each. Initiative shows it behind a "?" on the headers of the plug-in's parts and on its settings:

help: { en: "Links issues to tasks. Name a task's reference, such as **acme-7**, in an issue's title to link it." },

Who may use what

Your plug-in never decides who uses it: the community does, with the roles it already has. Every page, field, part, action and endpoint sits at a level and answers to a permission there. Inside an initiative, the initiative's roles hold it, as they hold a tool's permissions: its managers and the community's admins always do, and its managers decide for every other role. At the community level, the community's admins hold it, as they hold the parts of administering the community, and a custom role on the admin rung may keep only some.

Every plug-in has use at each level without declaring it. Declare more when the community should be able to give some people a part of your plug-in and not the rest:

permissions: [
  { id: "use", level: "initiative", name: { en: "Use the board" }, members: true },
  { id: "prices", level: "initiative", name: { en: "See prices" } },
  { id: "settings", level: "community", name: { en: "Set up the board" } },
],
fields: {
  "board.price": { name: { en: "Price" }, kind: "currency", currency: "EUR", on: ["task"], permission: "prices" },
},

members says whether a role starts with an initiative permission where nobody in the community said otherwise; absent, only the roles the community chooses hold it. A page names one permission for every level it renders in, so one rendering at both names one declared at both. An endpoint naming a permission is read only by those who hold it in the initiative it is read in. Another plug-in calling one of your public endpoints for a member is held to that member's permission for it, the one it names or use; one calling as the community, to what the community granted it. A handoff and an ID token carry the ids the person holds where the page was opened as permissions, so your pages can shape themselves the same way.

Where a community stands

communitySummary names a read whose returns say what a community has used and is allowed. A deployment may draw them on the community's settings page, each under its own label. A return with of is counted against another, so the two are drawn as one measure:

returns: {
  runs_used: { type: "int", label: { en: "Runs this month" }, of: "allowance" },
  allowance: { type: "int", label: { en: "Monthly allowance" } }, // null: no ceiling
  pack_credits: { type: "int", label: { en: "Credits left" } },
  resets_on: { type: "datetime", label: { en: "Resets" } },
},

How one connection stands, such as whether its account has synced, is that connection's own summary, drawn beneath it (After connecting).

Minimum age

minimumAge says how old somebody must be to use the plug-in, by ISO 3166-1 alpha-2 country, with default for every country not listed: { default: 16, US: 13 }. It is a declaration; whether a deployment enforces it is the deployment's decision.