Documentation
  • 👋Welcome to Cerberus
  • Overview
    • 💡What we do
    • ✨Our Features
  • Product Guides
    • 💡Core concepts
    • 🍎Creating an App
    • 📎Modeling your domain
    • 📄Creating policies
  • Tutorial
    • 🛠️Getting set up
      • 🌠Cloning project
      • 👷Setting up workspace
      • 🏃‍♂️Build and run app
    • 📏Creating static rules
      • Create an account
      • Add migrations
    • ✍️Implementation
      • Backend
        • Migrate existing data
        • Routes
        • Services
          • User
          • Project
          • Sprint
          • Story
      • Frontend
        • Settings
        • Projects
        • Sprints
        • Stories
  • APIs
    • 🎨REST API
    • 🖥️Websocket API
  • Migrations
    • 🐧Scripting language
    • 🏃‍♂️Running migrations
Powered by GitBook
On this page
  1. Migrations

Scripting language

PreviousWebsocket APINextRunning migrations

Last updated 2 years ago

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.

🐧
Running migrations