Skip to content

Comments

Adding toJson JNI method for Policy object#187

Merged
mark-creamer-amazon merged 1 commit intocedar-policy:release/3.2.xfrom
mark-creamer-amazon:release/3.2.x
Aug 13, 2024
Merged

Adding toJson JNI method for Policy object#187
mark-creamer-amazon merged 1 commit intocedar-policy:release/3.2.xfrom
mark-creamer-amazon:release/3.2.x

Conversation

@mark-creamer-amazon
Copy link
Contributor

@mark-creamer-amazon mark-creamer-amazon commented Aug 13, 2024

#171

Backporting changes from #172

Tested these changes locally with the tip of cedar-java-hello-world 3.2.x

// permit(principal == User::"Alice", action == Action::"View_Photo", resource in Album::"Vacation");
Set<Policy> policySet = buildPolicySlice();
Policy policy = policySet.iterator().next();
System.out.println(policy.toJson());

{"effect":"permit","principal":{"op":"==","entity":{"type":"User","id":"Alice"}},"action":{"op":"==","entity":{"type":"Action","id":"View_Photo"}},"resource":{"op":"in","entity":{"type":"Album","id":"Vacation"}},"conditions":[]}

@mark-creamer-amazon mark-creamer-amazon merged commit d8ba863 into cedar-policy:release/3.2.x Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants