Łukasz Szydło
07/31/2025, 9:53 AMContext context = new Context();
context.put("enable_abac_user_permissions", Boolean.TRUE);
UserPermissions userPermissions = permit.getUserPermissions(new GetUserPermissionsQuery(User.fromString("123"), null,null, null, context));
I only get roles, but no resources or permissions. I have ABAC permission configured with resource and user attributes. Any clue what am I doing wrong ?Ask Inkeep
07/31/2025, 9:53 AMAsk Inkeep
07/31/2025, 9:53 AMpermit.getUserPermissions function determines all user permissions for every registered resource across all tenants (1) .
The correct Java syntax from the documentation is:
import io.permit.sdk.Permit;
import io.permit.sdk.PermitConfig;
import io.permit.sdk.enforcement.*;
import java.util.Arrays;
Permit permit = new Permit(
new PermitConfig.Builder("[YOUR_API_KEY]") .build()
) ;
UserPermissions permissions = permit.getUserPermissions(
new GetUserPermissionsQuery(
User.fromString("<mailto:john@doe.com|john@doe.com>")
)
) ;
The function accepts a "User" as input and optionally a list of tenants to filter, and returns an object containing the details about the request for each assigned tenant, including the assigned tenant's attributes, and the allowed permissions .
Since you're experiencing issues with ABAC permissions not showing resources or permissions, I need some additional information to help our engineers investigate:
1. Which Workspace / Project / Env are you using?
2. What calls are you performing (as SDK code or CURL) ?
3. Which PDP version are you running?
4. Can you share relevant logs from your PDP?
This will help identify if there's a configuration issue with your ABAC setup or PDP version compatibility.Ask Inkeep
07/31/2025, 9:54 AMRaz Co
07/31/2025, 9:57 AMArrays.asList("document", "__tenant"), // resource types is always required for ABAC, __tenants is required to not ignore RBAC-based permissions
you’ll have to specify the resource typeŁukasz Szydło
07/31/2025, 9:58 AMŁukasz Szydło
07/31/2025, 10:08 AMŁukasz Szydło
07/31/2025, 10:10 AMRaz Co
07/31/2025, 10:40 AMOmer Zuarets
07/31/2025, 10:48 AMŁukasz Szydło
07/31/2025, 10:54 AMOmer Zuarets
07/31/2025, 10:58 AMContext context = new Context();
context.put("enable_abac_user_permissions", Boolean.TRUE);
UserPermissions userPermissions = permit.getUserPermissions(new GetUserPermissionsQuery(User.fromString("123"), null,null, null, context));Łukasz Szydło
07/31/2025, 10:58 AMHashMap<String, Object> resourceAttributes = new HashMap<>();
resourceAttributes.put("location", "NO");
// System.out.println("UserKey: "+user.key);
String action = "read";
Resource resource = new Resource.Builder("Chargar").withAttributes(resourceAttributes).build();
try {
UserRead userRead = permit.api.users.get("123");
boolean check = permit.check(User.fromString("123"), action, resource);
System.out.println(check);
Context context = new Context();
context.put("enable_abac_user_permissions", Boolean.TRUE);
UserPermissions userPermissions = permit.getUserPermissions(new GetUserPermissionsQuery(User.fromString("123"), null, List.of("Chargar", "NO_chargers", "__tenant"), null, context));Omer Zuarets
07/31/2025, 11:43 AM• Is the resource you are checking synced as a resource instance in the permit environment with the relevant attributes?I guess from the code that the resource instance is not synced into permit as you send the attributes on the fly to the permit.check call abac get user permissions requires you either to use synced resource instance or to send the resource instances that you want to “check on” The main reason is that the policy evaluation needs to know which actual resource instances can be checked on, as attributes are set on instances
Łukasz Szydło
07/31/2025, 11:47 AMOmer Zuarets
07/31/2025, 12:49 PMŁukasz Szydło
07/31/2025, 3:04 PMOmer Zuarets
07/31/2025, 4:15 PM