Abe Clark
08/16/2025, 7:19 AMAsk Inkeep
08/16/2025, 7:19 AMAsk Inkeep
08/16/2025, 7:19 AMawait permit.api.sync_user(
{
"key": "<mailto:john@acme.com|john@acme.com>",
}
)
And assigning them roles on resources:
await permit.api.role_assignments.assign(
{
"user": "<mailto:john@acme.com|john@acme.com>",
"role": "viewer",
"resource_instance": "file:2023_report",
}
)
For audit logging, Permit.io does provide comprehensive audit logs that capture (2) :
• Timestamp of attempted actions
• User/machine who attempted the action
• Description of the attempted action
• The resource targeted
• Authorization decision (Permitted or Denied)
• Reasoning behind the authorization decision
To implement true public link sharing with unauthenticated access while maintaining audit logs, you'd likely need to create a special "anonymous" user entity or extend the current model. The sources don't provide a specific example of this pattern.
Would you like me to provide a general approach based on authorization patterns, or would you prefer to reach out to Permit.io support at Email for guidance on implementing this specific use case?Ask Inkeep
08/16/2025, 7:19 AMAbe Clark
08/16/2025, 7:23 AMAsk Inkeep
08/16/2025, 7:23 AMAsk Inkeep
08/16/2025, 7:23 AM{
"allOf": [
{
"user.university": {
"equals": "Stanford"
}
},
{
"user.is_full_time": true
}
]
}
The key issue might be in how you're passing attributes during the check. According to the documentation, you need to pass user attributes in the permit.check call (2) :
const permitted = await permit.check(
{
key: user,
attributes: { strongAuth: !!OTP, location },
},
"create",
{
type: "Transaction",
attributes: { ...transaction },
tenant,
}
) ;
(3)
For your public sharing scenario, ensure you're:
1. *Passing the correct attributes in the check call* - The "unauthenticated" user needs attributes that match your User Set conditions (1)
2. *Including resource attributes* - Your Resource Set conditions need to match attributes passed in the resource object:
const permitted = await permit.check(userKey, "read", {
type: "file",
attributes: {
owners: [
"d08c85a349994aeb89a3f02c08bdb340",
"48fb889360604253a5189580b48694cf",
],
},
}) ;
(4)
3. *Verifying the condition syntax* - Resource Set conditions should look like:
{
"allOf": [
{
"resource.amount": {
"less-than-equals": 1000
}
}
]
}
(3)
To help debug further, could you share:
1. Which Workspace / Project / Env you're using
2. The exact SDK calls you're making (as code or CURL)
3. Which PDP version you're running
4. Any relevant logs from your PDP
This will help identify why the permissions aren't being granted as expected.Ask Inkeep
08/16/2025, 7:23 AMAbe Clark
08/16/2025, 7:48 AMAbe Clark
08/16/2025, 7:48 AMAsk Inkeep
08/16/2025, 7:48 AMAsk Inkeep
08/16/2025, 7:48 AMpermitted = await permit.check(
# User with attributes
{
"key": "<mailto:check@permit.io|check@permit.io>",
"attributes": {
"location": "England",
"department": "Engineering",
},
},
# Action
"action",
# Resource with attributes
{
"type": "resource",
"attributes": {
"hasApproval": "true",
},
"tenant": "tenant",
}
)
For your Task resource with privacy_status attribute, the check should include:
permitted = await permit.check(
# the user object
{
# the user key
"key": "<mailto:check@permit.io|check@permit.io>",
# just-in-time attributes on the user
"attributes": {
"location": "England",
"department": "Engineering",
},
},
# the action the user is trying to do
"action",
# Resource
{
# the type of the resource (the resource key)
"type": "resource",
# just-in-time attributes on the resource
"attributes": {
"hasApproval": "true",
},
# the tenant the resource belong to
"tenant": "tenant",
}
)
The key point is that resource attributes must be passed at check time as "just-in-time attributes" . These attributes are merged with (and override) any persisted resource attributes .
To help debug this further, could you provide:
1. Which Workspace / Project / Env you're using
2. What calls you're performing (as SDK code or CURL)
3. Which PDP version you're running
4. Relevant logs from your PDP
This will help our engineers investigate why the Resource Set conditions aren't being evaluated correctly.Ask Inkeep
08/16/2025, 7:48 AMAbe Clark
08/16/2025, 7:54 AMOr Weis
08/16/2025, 8:30 AMAbe Clark
08/16/2025, 7:51 PMPermit Support Automation
08/16/2025, 7:51 PM