{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/nexus/json-schema/nexus-api-privilege-script-schema.json",
  "title": "ApiPrivilegeScript",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/nexus-security-management-privileges-api-openapi.yml#/components/schemas/ApiPrivilegeScript",
  "required": [
    "actions",
    "name",
    "scriptName"
  ],
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "description": "The type of privilege, each type covers different portions of the system. External values supplied to this will be ignored by the system."
    },
    "name": {
      "minLength": 1,
      "pattern": "^[a-zA-Z0-9\\-]{1}[a-zA-Z0-9_\\-\\.]*$",
      "type": "string",
      "description": "The name of the privilege.  This value cannot be changed."
    },
    "description": {
      "type": "string"
    },
    "readOnly": {
      "type": "boolean",
      "description": "Indicates whether the privilege can be changed. External values supplied to this will be ignored by the system."
    },
    "actions": {
      "minItems": 1,
      "type": "array",
      "description": "A collection of actions to associate with the privilege, using BREAD syntax (browse,read,edit,add,delete,all) as well as 'run' for script privileges.",
      "items": {
        "type": "string",
        "description": "A collection of actions to associate with the privilege, using BREAD syntax (browse,read,edit,add,delete,all) as well as 'run' for script privileges.",
        "enum": [
          "READ",
          "BROWSE",
          "EDIT",
          "ADD",
          "DELETE",
          "RUN",
          "START",
          "STOP",
          "ASSOCIATE",
          "DISASSOCIATE",
          "ALL"
        ]
      }
    },
    "scriptName": {
      "minLength": 1,
      "type": "string",
      "description": "The name of a script to give access to."
    }
  }
}