Skip to main content
v0.0.x

Cedar Language

Permguard integrates Cedar as policy language. Here you can find the official documentation.

Policies are written using the Cedar Policy Language.

danger

Permguard mandates the use of the @id annotation in Cedar policies. This is required to uniquely identify each policy.

Below is an example directory structure with a schema file and sample policy files:

.
├── .permguard
├── schema.json
├── staff_policies.cedar

Here is an example of cedar policy.

platform-policies.cedar
@id("branch-create")
permit(
principal == Permguard::Identity::Attribute::"role/platform-admin",
action == PharmaGovFlow::Platform::Action::"create",
resource is PharmaGovFlow::Platform::Branch
);