Is Authorized
POST/user-svc/permission/:permissionId/is-authorized
Check if a user is authorized for a specific permission.
Request
Path Parameters
Permission ID
- application/json
Body
Is Authorized Request
Responses
- 200
- 400
- 401
OK
- application/json
- Schema
- Example (from schema)
Schema
Array [
]
user
object
contacts
object[]
Contacts are used for login and identification purposes.
The unique identifier, which can be a URL.
Example values: "joe12" (singulatron username), "twitter.com/thejoe" (twitter url), "joe@joesdomain.com" (email)
If this is the primary contact method
Platform of the contact (e.g., "email", "phone", "twitter")
Value is the platform local unique identifier.
Ie. while the id
of a Twitter contact is twitter.com/thejoe
, the value will be only thejoe
.
For email and phones the id
and the value
will be the same.
This field mostly exists for display purposes.
Example values: "joe12" (singulatron username), "thejoe" (twitter username), "joe@joesdomain.com" (email)
Whether the contact is verified
Full name of the organization.
URL-friendly unique (inside the Singularon platform) identifier for the user
.
{
"authorized": true,
"user": {
"contacts": [
{
"createdAt": "string",
"deletedAt": "string",
"id": "twitter.com/thejoe",
"isPrimary": true,
"platform": "twitter",
"updatedAt": "string",
"userId": "string",
"value": "thejoe",
"verified": true
}
],
"createdAt": "string",
"deletedAt": "string",
"id": "string",
"name": "Jane Doe",
"passwordHash": "string",
"slug": "jane-doe",
"updatedAt": "string"
}
}
Invalid JSON or missing permission id
- application/json
- Schema
- Example (from schema)
Schema
{
"error": "string"
}
Unauthorized
- application/json
- Schema
- Example (from schema)
Schema
{
"error": "string"
}