AlmondTill/G3N API

Change what someone can do

Adjust a person’s roles — what the platform will and will not let them do.

Manage · a play in 2 steps.

In the office

Read the full picture of what a person may do today, then replace their roles with the new set. Access follows the roles, not the person’s title: a cashier who covers the back room on Saturdays needs the receiver’s role for that, and nothing else changes.

Where it starts: the office’s Users page.

Users — /users
Users — /users

Step 1. See the full picture of what they may do today.

Step 2. Replace their role assignments with the new set.

What you see

The example shop has 11 people: Mei-Ling Chow (active) · Jonah Whitfield (active) · Sofia Rinaldi (active) · Liam Carter (active) · Aisha Bello (active) · Theo Brandt (active) · Hana Suzuki (active) · Daniel Moreau (active) · Priya Raman (active) · Marcus Okafor (active) · Linnea Vale (active).

Try it

Walked with screenshots in the owner’s manual: chapter 5 — See who has access, and change what someone can do

For developers — the calls

The steps

  1. See the full picture of what they may do today. — effectivePermissions
  2. Replace their role assignments with the new set. — updateUser

The calls

Every operation this use case runs, in the order it first appears, with the request and the response its reference page shows.

effectivePermissions

effectivePermissions — query · This page — the full picture of what a user may and may not do at an organization.

Example request

graphql
query ExampleEffectivePermissions($userId: ID!, $organizationId: ID!) {
  effectivePermissions(userId: $userId, organizationId: $organizationId) {
    authorityTier
  }
}

Variables:

json
{
  "userId": "01900000-0000-7000-8000-e0a63e120000",
  "organizationId": "01900000-0000-7000-8000-1971e30a0000"
}

Example response

json
{
  "data": {
    "effectivePermissions": {
      "authorityTier": "<authority tier>"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": null,
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

updateUser

updateUser — mutation · Edit a staff user — change its details.

Example request

graphql
mutation ExampleUpdateUser($id: ID!, $revision: ID!, $input: EditUserInput!) {
  updateUser(id: $id, revision: $revision, input: $input) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    accountId
  }
}

Variables:

json
{
  "id": "01900000-0000-7000-8000-e0a63e120000",
  "revision": "01900000-0000-7000-8000-b7960e180000",
  "input": {
    "caption": "Blue jeans"
  }
}

Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.

Example response

json
{
  "data": {
    "updateUser": {
      "id": "01900000-0000-7000-8000-e0a63e120000",
      "sysId": "US-EXMP-0000-000F",
      "type": "User",
      "caption": "Blue jeans",
      "status": "active",
      "parentId": "01900000-0000-7000-8000-eacdfcfd0000",
      "rootId": "01900000-0000-7000-8000-a1295a650000",
      "createdAt": "2027-01-31T00:00:00.000Z",
      "updatedAt": "2027-01-31T00:00:00.000Z",
      "revisionNum": 1,
      "revision": "01900000-0000-7000-8000-53c6eea90000",
      "accountId": "01900000-0000-7000-8000-59f8a2fc0000"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}