Shyamalan Chemmery
05/19/2026, 2:54 PMAsk Inkeep
05/19/2026, 2:54 PMAsk Inkeep
05/19/2026, 2:54 PMpermit.check() call and reference it in your condition set (1) .
First, create a user attribute for current_time in the Permit dashboard under User Attributes .
Then, in your condition set, you can compare current_time against other time-based attributes. For example, to check if access should expire based on time :
{
"allOf": [
{
"user.time_based_groups": {
"any_match": {
"match": {
"expires": {
"greater-than-equals": {
"ref": "user.current_time"
}
}
}
}
}
}
]
}
When making the permission check, pass current_time as a user attribute :
const permitted = await permit.check(
{
key: "<mailto:george@test.com|george@test.com>",
attributes: {
current_time: new Date() .getTime() ,
},
},
"patch",
{
type: "_internal_api",
tenant: "coke",
}
) ;Ask Inkeep
05/19/2026, 2:55 PMShyamalan Chemmery
05/19/2026, 3:02 PMShyamalan Chemmery
05/19/2026, 3:13 PMOr Weis
05/19/2026, 3:21 PMAsk Inkeep
05/19/2026, 3:21 PMAsk Inkeep
05/19/2026, 3:21 PMauthorized_users endpoint (1) (2) .
The sources explain that ABAC uses four types of attributes: Subject Attributes (user-related) , Resource Attributes, Action Attributes, and Environmental Attributes (including time, location, and device) (1) . However, the specific implementation details for passing context attributes separately from user attributes, or how to use them with the authorized_users endpoint, are not covered in the available documentation (1) (2) .
For the authorized_users endpoint specifically and how to pass context/environmental attributes in that context, I'd recommend reaching out for clarification.
Would you like me to provide a general answer based on my broader knowledge of how context attributes typically work in authorization systems, or would you prefer to wait for officAsk Inkeep
05/19/2026, 3:21 PMShyamalan Chemmery
05/19/2026, 3:24 PMOr Weis
05/19/2026, 3:27 PMAsk Inkeep
05/19/2026, 3:27 PMAsk Inkeep
05/19/2026, 3:27 PMpermit.check() function (2) . Here's an example structure:
const permitted = await permit.check(
{
key: "<mailto:john@permit.io|john@permit.io>",
attributes: {
location: "England",
department: "Engineering",
},
},
{
type: "create",
},
{
type: "document",
attributes: {
hasApproval: "true",
},
tenant: "companyB",
}
) ;
In this example, location is an environmental attribute that can be used in your ABAC policy conditions . The environmental context (time, location, device) is evaluated alongside subject attributes, resource attributes, and action attributes to make the authorization decision (1) .Ask Inkeep
05/19/2026, 3:27 PMdavid
05/19/2026, 3:32 PMShyamalan Chemmery
05/19/2026, 3:50 PMdavid
05/19/2026, 4:06 PMcontext can't be referenced from condition sets. It's accepted on every authorization endpoint but reserved for custom policy code (Rego/Cedar via GitOps). Condition set ref expressions only resolve user.*, resource.*, and tenant.*.
For current time in authorized_users, pass it as a resource attribute — those are referenceable via `ref: "resource.current_time"`:
curl --location '<http://localhost:7766/authorized_users>' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <api key>' \
--data '{
"action": "read",
"resource": {
"type": "Document",
"tenant": "default",
"attributes": { "current_time": 1747900000000 },
"context": { "enable_abac_authorized_users": true }
}
}'
Condition (e.g. document's expires_at vs caller's current_time):
{
"resource.expires_at": {
"greater-than-equals": {
"ref": "resource.current_time"
}
}
}
enable_abac_authorized_users: true is still required to enable ABAC eval on authorized_users (docs)Shyamalan Chemmery
05/19/2026, 4:13 PM