In order to support migration of static rules (Resource Types, Actions and Policies), we've built a simple DSL (domain specific language) based on LISP type S-expressions.
The expressions are very simple, and always take this form:
(function_name "arg1" "arg2" ...)
Usually S-expressions can be nested, the return value of an expression being the argument of the surrounding expression. However, we decided to keep our language basic, not supporting nesting. This make reading and understanding migration files much easier.
All commands listed below will modify the static rules of your app in some way. They are all idempotent, meaning you can run the same command as many time as you like.
You can include them in versioned migration scripts to be migrated up or down as your app evolves over time. More information in .
Add To Policy
(atp policy resourceType ...actions)
Adds Action(s) 'actions' on ResourceType 'resourceType' to Policy 'policy'
Create Actions
(ca resourceType ...name)
Creates new Action(s) with 'name' on ResourceType 'resourceType'
Create Policy
(cp name description)
Creates a new Policy with 'name' and 'description'
Create Resource Type
(crt name parent)
Creates a new Resource Type with 'name' and 'parent'
Delete Actions
(da resourceType ...name)
Deletes Action(s) with 'resourceType' and 'name'
Delete Policy
(dp name)
Deletes a Policy with 'name'
Delete Resource Type
(drt name)
Deletes a Resource Type with 'name'
Invalidate Policy
(ip name)
Invalidates a Policy with 'name'
Once invalidated, a policy won't be selectable for permissions anymore.
Move Resource Type
(mrt name newparent)
Move a Resource Type with 'name' to parent 'newparent'
Remove From Policy
(rfp policy resourceType ...actions)
Removes Action(s) 'actions' on ResourceType 'resourceType' from Policy 'policy'
Rename Action
(ra resourceType name newname)
Renames an Action with 'resourceType' and 'name' to 'newname'
Rename Policy
(rp name newname)
Renames a Policy with 'name' to 'newname'
Rename Resource Type
(rrt name newname)
Renames a Resource Type with 'name' to 'newname'
Set Policy Description
(spd name newdescription)
Sets the description of a Policy with 'name' to 'newdescription'
Validate Policy
(vp name)
Validates a previously invalidated Policy with 'name'
Once validated, it will be selectable for permissions again.