Language
Permguard integrates Cedar
as policy language. Here you can find the official documentation.
Policies are written using the Cedar Policy Language
.
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.
@id("platform-creator")
permit(
principal == Permguard::IAM::RoleActor::"platform-creator",
action == MagicFarmacia::Platform::Action::"create",
resource is MagicFarmacia::Platform::Subscription
)
when {
context.isSubscriptionActive == true
&& action.isEnabled == true && resource.isEnabled == true
}
unless {
principal.isSuperUser == false
};