Distinguishing between reading and writing actions

henning-koch edited this page Sep 13, 2010 · 2 revisions

Aegis tracks whether an action is reading or writing. This allows you to allow or deny all reading or writing actions of a resource:

resources :projects do

  writing do
    allow :admin

  reading do
    allow :everyone


By default resources create show and index as reading actions. All other actions (update, create, destroy) are created as writing actions by default.

Defining a reading action

When you define a new custom action, it is considered to be writing by default. You can create a read-only action like this:

action :foo, :writing => false