Updates a permission. permission_id, tenant and fields to update are required in update_permission

Permission Level: Read-Write

PUT /users/permissions/{identifier}

Operation id: PermissionService_UpdatePermission

Tags: PermissionService

Parameters

Path parameters

NameTypeRequiredDescription
identifierstringYesThe identifier value used to update the Permission

Security

  • Authorization (apiKey)
    • Bearer token

Responses

200 — A successful response.

Content type: application/json

default — An unexpected error response.

Content type: application/json

Request body

Required: Yes

application/json

Schema

PropertyTypeRequiredDescription
ownerTenantIdstringNo
identifierTypestringNo- PERMISSION_ID: By Permission ID. This is the default option. - FRIENDLY_ID: By friendly ID.
updatePermissionobjectNo
updateFieldMaskstringNo
{
  "type": "object",
  "properties": {
    "ownerTenantId": {
      "type": "string"
    },
    "identifierType": {
      "type": "string",
      "description": "- PERMISSION_ID: By Permission ID. This is the default option.\n - FRIENDLY_ID: By friendly ID.",
      "enum": [
        "PERMISSION_ID",
        "FRIENDLY_ID"
      ],
      "default": "PERMISSION_ID"
    },
    "updatePermission": {
      "type": "object",
      "properties": {
        "scope": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "grants": {
          "type": "string"
        },
        "tenants": {
          "type": "string"
        },
        "targets": {
          "type": "array",
          "items": {
            "type": "object",
            "description": "Targets describe what the permission applies to.\nFor example if you wanted to have an admin permission and wanted the user to only have permissions on unitA and unitB\nyou would design your target like this:\nid_type = \"byUnit\"\nid = \"unitA,unitB\"\nThe actual values used are free form and determined by the application when designing their authorization model.\nSome standards we try to stick to despite the free form are:\nid_type we try and model with by{{Thing}}.  The most common use case for this is byTenant (which we moved up to the base permission\nlevel, see permission.proto).\nFor ID, which is the actual value this is giving access to we recommend using:\n* - if the user should have access to everything in that Thing.  so a byTenant - * permission would give access to ALL tenants.\n^ - gives access to the user's own Thing.  For example - byTenant - ^ would give access to the user's own tenant.\nThis gives the ability to create a single permission that can be used by multiple roles.\nOtherwise we use a specific value, so byTenant - mytenant would give access to the \"mytenant\" tenant.  This is best used for giving\naccess to someone outside of our tenant to your tenant, or if you have a list of specific things that wont change depending on who\nhas access to the permission.",
            "properties": {
              "idType": {
                "type": "string"
              },
              "id": {
                "type": "string",
                "description": "The value that the target applies to."
              }
            }
          }
        },
        "roles": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "tenantId": {
                "type": "string",
                "description": "The ID of the tenant. Required: false. Defaults to the tenant of the user making the call."
              },
              "domain": {
                "type": "string",
                "description": "The platform domain. Required: true. (e.g. ZPA, Reflexis, WFC)\nDefaults to the domain in the request."
              },
              "scope": {
                "type": "string",
                "description": "Some more general scoping for the data (like a particular app in the domain). Required: false."
              },
              "roleId": {
                "type": "string",
                "description": "The role ID. Required: true."
              },
              "userIds": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          }
        },
        "users": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "tenantId": {
                "type": "string",
                "description": "The ID of the tenant. Required: false. Defaults to the tenant of the user making the call."
              },
              "userId": {
                "type": "string",
                "description": "The user ID. Required: true."
              },
              "firstName": {
                "type": "string",
                "description": "The first name. Required: false."
              },
              "lastName": {
                "type": "string",
                "description": "The last name. Required: false."
              }
            }
          }
        },
        "groupIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "friendlyId": {
          "type": "string"
        },
        "deactivated": {
          "type": "object",
          "properties": {
            "deactivated": {
              "type": "boolean"
            }
          }
        },
        "grantFriendlyName": {
          "type": "string",
          "description": "Friendly name of the grant from PERMISSION_GRANTS property. Required: false."
        },
        "grantDescription": {
          "type": "string",
          "description": "Description of the grant from PERMISSION_GRANTS property. Required: false."
        }
      }
    },
    "updateFieldMask": {
      "type": "string"
    }
  }
}

Response models

200 — A successful response.

Content type: application/json

Schema

PropertyTypeRequiredDescription
permissionIdstringNo
ownerTenantIdstringNoOwner tenant of the permission to which it belongs.
friendlyIdstringNo
domainstringNo
scopestringNo
descriptionstringNo
typestringNo
grantsstringNo
tenantsstringNo
targetsarrayNo
rolesarrayNo
usersarrayNo
systemLevelbooleanNo
groupIdsarrayNo
deactivatedbooleanNo
creationTimestring (date-time)No
lastUpdatedstring (date-time)No
typeFriendlyNamestringNoFriendly name of the type of permission. Blank if not set.
scopeFriendlyNamestringNoFriendly name of the scope of the permission. Blank if not set.
grantFriendlyNamestringNoFriendly name of the grant from PERMISSION_GRANTS property. Blank if not set.
grantDescriptionstringNoDescription of the grant from PERMISSION_GRANTS property. Blank if not set.
{
  "type": "object",
  "properties": {
    "permissionId": {
      "type": "string"
    },
    "ownerTenantId": {
      "type": "string",
      "description": "Owner tenant of the permission to which it belongs."
    },
    "friendlyId": {
      "type": "string"
    },
    "domain": {
      "type": "string"
    },
    "scope": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "grants": {
      "type": "string"
    },
    "tenants": {
      "type": "string"
    },
    "targets": {
      "type": "array",
      "items": {
        "type": "object",
        "description": "Targets describe what the permission applies to.\nFor example if you wanted to have an admin permission and wanted the user to only have permissions on unitA and unitB\nyou would design your target like this:\nid_type = \"byUnit\"\nid = \"unitA,unitB\"\nThe actual values used are free form and determined by the application when designing their authorization model.\nSome standards we try to stick to despite the free form are:\nid_type we try and model with by{{Thing}}.  The most common use case for this is byTenant (which we moved up to the base permission\nlevel, see permission.proto).\nFor ID, which is the actual value this is giving access to we recommend using:\n* - if the user should have access to everything in that Thing.  so a byTenant - * permission would give access to ALL tenants.\n^ - gives access to the user's own Thing.  For example - byTenant - ^ would give access to the user's own tenant.\nThis gives the ability to create a single permission that can be used by multiple roles.\nOtherwise we use a specific value, so byTenant - mytenant would give access to the \"mytenant\" tenant.  This is best used for giving\naccess to someone outside of our tenant to your tenant, or if you have a list of specific things that wont change depending on who\nhas access to the permission.",
        "properties": {
          "idType": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "description": "The value that the target applies to."
          }
        }
      }
    },
    "roles": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "tenantId": {
            "type": "string",
            "description": "The ID of the tenant. Required: false. Defaults to the tenant of the user making the call."
          },
          "domain": {
            "type": "string",
            "description": "The platform domain. Required: true. (e.g. ZPA, Reflexis, WFC)\nDefaults to the domain in the request."
          },
          "scope": {
            "type": "string",
            "description": "Some more general scoping for the data (like a particular app in the domain). Required: false."
          },
          "roleId": {
            "type": "string",
            "description": "The role ID. Required: true."
          },
          "userIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    },
    "users": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "tenantId": {
            "type": "string",
            "description": "The ID of the tenant. Required: false. Defaults to the tenant of the user making the call."
          },
          "userId": {
            "type": "string",
            "description": "The user ID. Required: true."
          },
          "firstName": {
            "type": "string",
            "description": "The first name. Required: false."
          },
          "lastName": {
            "type": "string",
            "description": "The last name. Required: false."
          }
        }
      }
    },
    "systemLevel": {
      "type": "boolean"
    },
    "groupIds": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "deactivated": {
      "type": "boolean"
    },
    "creationTime": {
      "type": "string",
      "format": "date-time"
    },
    "lastUpdated": {
      "type": "string",
      "format": "date-time"
    },
    "typeFriendlyName": {
      "type": "string",
      "description": "Friendly name of the type of permission. Blank if not set."
    },
    "scopeFriendlyName": {
      "type": "string",
      "description": "Friendly name of the scope of the permission. Blank if not set."
    },
    "grantFriendlyName": {
      "type": "string",
      "description": "Friendly name of the grant from PERMISSION_GRANTS property. Blank if not set."
    },
    "grantDescription": {
      "type": "string",
      "description": "Description of the grant from PERMISSION_GRANTS property. Blank if not set."
    }
  }
}

default — An unexpected error response.

Content type: application/json

Schema

PropertyTypeRequiredDescription
codeinteger (int32)No
messagestringNo
detailsarrayNo
{
  "type": "object",
  "properties": {
    "code": {
      "type": "integer",
      "format": "int32"
    },
    "message": {
      "type": "string"
    },
    "details": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "@type": {
            "type": "string"
          }
        }
      }
    }
  }
}