{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "channelOverride": {
      "description": "Allow / deny lists scoped to a single channel.",
      "properties": {
        "allow": {
          "description": "Permissions granted within this channel.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "channel": {
          "description": "The channel this override applies to.",
          "format": "record-key",
          "type": "string"
        },
        "deny": {
          "description": "Permissions denied within this channel. Deny wins over base permissions and overrides allow.",
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "required": [
        "channel"
      ],
      "type": "object"
    },
    "main": {
      "description": "A named bundle of permissions assignable to community members. Lives on the community repo.",
      "key": "tid",
      "record": {
        "properties": {
          "$type": {
            "description": "The type of the record.",
            "format": "nsid",
            "type": "string"
          },
          "channelOverrides": {
            "description": "Per-channel permission overrides for this role.",
            "items": {
              "ref": "lex:social.colibri.role#channelOverride",
              "type": "ref"
            },
            "type": "array"
          },
          "color": {
            "description": "Optional hex color displayed alongside the role (e.g. '#ff8800').",
            "type": "string"
          },
          "hoisted": {
            "default": false,
            "description": "Whether members of this role are displayed separately in the member list.",
            "type": "boolean"
          },
          "mentionable": {
            "default": false,
            "description": "Whether `@role`-style mentions resolve to this role.",
            "type": "boolean"
          },
          "name": {
            "description": "Display name of the role.",
            "maxLength": 32,
            "minLength": 1,
            "type": "string"
          },
          "permissions": {
            "description": "Permission identifiers granted by this role.",
            "items": {
              "description": "A namespaced permission identifier. See AppView permission catalog.",
              "type": "string"
            },
            "type": "array"
          },
          "position": {
            "description": "Hierarchy position. Higher values sit higher in the role hierarchy and outrank lower values.",
            "type": "integer"
          },
          "protected": {
            "default": false,
            "description": "Whether this role is protected from modification or deletion. Set true for system-managed roles (e.g. the bootstrap 'Owner' role minted by `community.create`).",
            "type": "boolean"
          }
        },
        "required": [
          "name",
          "permissions",
          "position"
        ],
        "type": "object"
      },
      "type": "record"
    }
  },
  "id": "social.colibri.role",
  "lexicon": 1,
  "revision": 2
}
