Add users to a Permission. permission_id, tenant and a list of users are required to be added to permission. This in not a recommended service.

Please add permissions and users to a role (see CreatePermission above or role.proto) to grant user permissions. Permission Level: Read-Write

POST /users/permissions/{permissionId}/users

Operation id: PermissionService_AddPermissionUsers

Tags: PermissionService

Parameters

Path parameters

NameTypeRequiredDescription
permissionIdstringYespermission_id of the permission, Required: true

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
usersarrayNo
{
  "type": "object",
  "properties": {
    "ownerTenantId": {
      "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."
          }
        }
      }
    }
  }
}

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"
          }
        }
      }
    }
  }
}