Get all actions for a subject #3274
|
Hello, Is there a way i can get all actions for a resource for a subject? I want to what actions are permitted for Jen and Jack for a resource "Sample.txt" Regards |
Replies: 1 comment 1 reply
|
Hi Max, Great question. OpenTDF doesn't currently have a single API call that returns "here are all the actions Jen can perform on Sample.txt." Happy to put in a feature request for that functionality, especially if there are others with the same need. There are two APIs that get you close, but each requires some extra work on your side: Option 1: Check each action individually with If you know the set of possible actions (e.g., read, update, delete), you can call (Sidenote: we have a planned helper method in the works to make that entityIdentifier setter method less verbose) If you need to check multiple subjects or resources, Option 2: Use
One important note: OpenTDF works with attribute values, not file names directly. "Sample.txt" would need to be associated with attribute values (e.g., via TDF encryption), and the authorization queries reference those attribute values. The full authorization docs are here: https://opentdf.io/sdks/authorization Let us know if either of these will work for you as a workaround 🙏 |
Hi Max,
Great question. OpenTDF doesn't currently have a single API call that returns "here are all the actions Jen can perform on Sample.txt." Happy to put in a feature request for that functionality, especially if there are others with the same need. There are two APIs that get you close, but each requires some extra work on your side:
Option 1: Check each action individually with
GetDecisionIf you know the set of possible actions (e.g., read, update, delete), you can call
GetDecisionfor each one and collect the results: