MCP Control
Компания и доступ · Изменение

Доступ · Разрешение · Сохранение

access_grant_save
Папки документов

Попробуйте три запроса

Подготовить
  1. Вы указываетеPositionid
  2. ПомощникПодготовка
  3. Вы получаетеПредпросмотр
Запрос в чат
Подготовь «Доступ / Разрешение / Сохранение». Для изменения нужны uid, сотрудник. Покажи объект и ожидаемый эффект до выполнения.
Что входит в подготовку
uid
Параметр
employeeId
Сотрудник
active
Активность
Применить
  1. Вы указываетеСогласованные значения
  2. ПомощникОдин вызов
  3. Вы получаетеОтвет операции
Запрос в чат
На учебной записи подготовь «Доступ / Разрешение / Сохранение» с параметром employeeId = DEMO-101. Покажи остальные обязательные значения и выполни действие, когда согласованы все поля.
Фрагмент учебных параметров
employeeId
DEMO-101
active
true
allLocations
true
Проверить итог
  1. Вы указываетеИсходный ответ
  2. ПомощникСверка результата
  3. Вы получаетеПодтверждение
Запрос в чат
Проверь результат «Доступ / Разрешение / Сохранение» по исходному ответу. Покажи companyId, uid. Объясни, чем подтвердить эффект для выбранного объекта.
Как сверить изменение
  1. До измененияПрочитать версию
  2. При записиПередать выбранную версию
  3. После ответаПеречитать объект
Как работает действие

Этот вызов может изменить рабочие данные. Согласуйте точный объект, новые значения и ожидаемый результат. Присвойте операции стабильный requestId. При повторе той же операции используйте прежний ключ и те же значения.

Описание разработчика

Create or replace a company member MCP grant within the current administrator AND OAuth scope ceiling. Requires protected membership, registered clients, validated locations and expectedVersion. An explicit positionId binds the protected policy and updates the existing native employee Position; omission preserves it. Does not change Firebase Auth.

Параметры запроса
positionId
positionId необязательно · string / null
uid
Exact Firebase account UID; must have protected membership in the connected company. обязательно по схеме · string · до символов 128
employeeId
Existing native employee UID or protected alias. обязательно по схеме · string · до символов 128
active
Whether the protected assignment is enabled. обязательно по схеме · boolean
permissions
Complete replacement permission ceiling; may not exceed current administrator and OAuth scopes. обязательно по схеме · array · до элементов 512
locationIds
Exact native locations within the current administrative ceiling. обязательно по схеме · array · до элементов 200
allLocations
Whether all company locations are allowed; cannot exceed the caller ceiling. обязательно по схеме · boolean
modules
Complete replacement enabled modules within the caller ceiling. обязательно по схеме · array · до элементов 80
integrations
Complete replacement enabled integrations within the caller ceiling. обязательно по схеме · array · до элементов 80
allowedClientIds
Registered OAuth client allowlist; null means unrestricted within the administrator ceiling. обязательно по схеме · array / null
expectedVersion
Exact current version; null only when creating a previously absent record. обязательно по схеме · integer / null
requestId
Ключ этой операции. Для повтора с теми же аргументами сохраните исходное значение. обязательно по схеме · string
Что вернёт команда
companyId
Company resolved from the authenticated connection. обязательно по схеме · string · до символов 128
uid
Exact Firebase account UID; must have protected membership in the connected company. обязательно по схеме · string · до символов 128
status
Current protected assignment state. обязательно по схеме · string · варианты active, revoked, not_granted
grant
Protected grant, or null before enrollment. обязательно по схеме · object / null
target
Existing native identity metadata. необязательно · object
Поля и технические схемы
Входные поля и поля ответа access_grant_save
Вход · JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "positionId": {
      "description": "positionId",
      "anyOf": [
        {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_~:@+.-]+$"
        },
        {
          "type": "null"
        }
      ]
    },
    "uid": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128,
      "pattern": "^[A-Za-z0-9_~:@+.-]+$",
      "description": "Exact Firebase account UID; must have protected membership in the connected company."
    },
    "employeeId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128,
      "pattern": "^[A-Za-z0-9_~:@+.-]+$",
      "description": "Existing native employee UID or protected alias."
    },
    "active": {
      "type": "boolean",
      "description": "Whether the protected assignment is enabled."
    },
    "permissions": {
      "maxItems": 512,
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 100,
        "pattern": "^[A-Za-z0-9_.:-]+$"
      },
      "description": "Complete replacement permission ceiling; may not exceed current administrator and OAuth scopes."
    },
    "locationIds": {
      "maxItems": 200,
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 128,
        "pattern": "^[A-Za-z0-9_~:@+.-]+$"
      },
      "description": "Exact native locations within the current administrative ceiling."
    },
    "allLocations": {
      "type": "boolean",
      "description": "Whether all company locations are allowed; cannot exceed the caller ceiling."
    },
    "modules": {
      "maxItems": 80,
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 128,
        "pattern": "^[A-Za-z0-9_~:@+.-]+$"
      },
      "description": "Complete replacement enabled modules within the caller ceiling."
    },
    "integrations": {
      "maxItems": 80,
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 128,
        "pattern": "^[A-Za-z0-9_~:@+.-]+$"
      },
      "description": "Complete replacement enabled integrations within the caller ceiling."
    },
    "allowedClientIds": {
      "anyOf": [
        {
          "maxItems": 200,
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2048,
            "pattern": "^[^\\s\\x00-\\x1f\\x7f]+$"
          }
        },
        {
          "type": "null"
        }
      ],
      "description": "Registered OAuth client allowlist; null means unrestricted within the administrator ceiling."
    },
    "expectedVersion": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        {
          "type": "null"
        }
      ],
      "description": "Exact current version; null only when creating a previously absent record."
    },
    "requestId": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{8,128}$",
      "description": "Stable operation ID. Reuse the exact arguments after an uncertain response."
    }
  },
  "required": [
    "uid",
    "employeeId",
    "active",
    "permissions",
    "locationIds",
    "allLocations",
    "modules",
    "integrations",
    "allowedClientIds",
    "expectedVersion",
    "requestId"
  ],
  "additionalProperties": false
}
Выход · JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "companyId": {
      "$ref": "#/$defs/_mcp0"
    },
    "uid": {
      "$ref": "#/$defs/_mcp1"
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "revoked",
        "not_granted"
      ],
      "description": "Current protected assignment state."
    },
    "grant": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "positionId": {
              "description": "positionId",
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128,
                  "pattern": "^[A-Za-z0-9_~:@+.-]+$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "uid": {
              "$ref": "#/$defs/_mcp1"
            },
            "employeeId": {
              "$ref": "#/$defs/_mcp2"
            },
            "active": {
              "type": "boolean",
              "description": "Whether the protected assignment is enabled."
            },
            "permissions": {
              "maxItems": 512,
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100,
                "pattern": "^[A-Za-z0-9_.:-]+$"
              },
              "description": "Complete replacement permission ceiling; may not exceed current administrator and OAuth scopes."
            },
            "locationIds": {
              "maxItems": 200,
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128,
                "pattern": "^[A-Za-z0-9_~:@+.-]+$"
              },
              "description": "Exact native locations within the current administrative ceiling."
            },
            "allLocations": {
              "type": "boolean",
              "description": "Whether all company locations are allowed; cannot exceed the caller ceiling."
            },
            "modules": {
              "maxItems": 80,
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128,
                "pattern": "^[A-Za-z0-9_~:@+.-]+$"
              },
              "description": "Complete replacement enabled modules within the caller ceiling."
            },
            "integrations": {
              "maxItems": 80,
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128,
                "pattern": "^[A-Za-z0-9_~:@+.-]+$"
              },
              "description": "Complete replacement enabled integrations within the caller ceiling."
            },
            "allowedClientIds": {
              "default": null,
              "description": "Registered OAuth client allowlist; null means unrestricted within the administrator ceiling.",
              "anyOf": [
                {
                  "maxItems": 200,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2048,
                    "pattern": "^[^\\s\\x00-\\x1f\\x7f]+$"
                  }
                },
                {
                  "type": "null"
                }
              ]
            },
            "companyId": {
              "$ref": "#/$defs/_mcp0"
            },
            "version": {
              "default": 0,
              "description": "Current optimistic concurrency version.",
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "revocationVersion": {
              "default": 0,
              "description": "Monotonic revocation epoch; revoked tokens cannot revive.",
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            }
          },
          "required": [
            "uid",
            "employeeId",
            "active",
            "permissions",
            "locationIds",
            "allLocations",
            "modules",
            "integrations",
            "allowedClientIds",
            "companyId",
            "version",
            "revocationVersion"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ],
      "description": "Protected grant, or null before enrollment."
    },
    "target": {
      "description": "Existing native identity metadata.",
      "type": "object",
      "properties": {
        "uid": {
          "$ref": "#/$defs/_mcp1"
        },
        "employeeId": {
          "$ref": "#/$defs/_mcp2"
        },
        "roleId": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9_~:@+.-]+$"
            },
            {
              "type": "null"
            }
          ],
          "description": "Native role metadata; never authority."
        },
        "locationId": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9_~:@+.-]+$"
            },
            {
              "type": "null"
            }
          ],
          "description": "Native profile location metadata."
        }
      },
      "required": [
        "uid",
        "employeeId",
        "roleId",
        "locationId"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "companyId",
    "uid",
    "status",
    "grant"
  ],
  "additionalProperties": false,
  "$defs": {
    "_mcp0": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128,
      "pattern": "^[A-Za-z0-9_~:@+.-]+$",
      "description": "Company resolved from the authenticated connection."
    },
    "_mcp1": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128,
      "pattern": "^[A-Za-z0-9_~:@+.-]+$",
      "description": "Exact Firebase account UID; must have protected membership in the connected company."
    },
    "_mcp2": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128,
      "pattern": "^[A-Za-z0-9_~:@+.-]+$",
      "description": "Existing native employee UID or protected alias."
    }
  }
}