Skip to content

Upgrading to Aegis 2

henning-koch edited this page · 6 revisions

As of May 2010, Aegis has has matured to version 2 and offers a great new API with many new features. Here is how you take your Aegis 1 setup and migrate it to Aegis 2:

  1. In your permission.rb, say action where you used to say permission.
  2. The crud_something macro is no longer available. Define your permissions using resources instead, which is much more expressive and compact.
  3. When you have an allow or deny with a block, that block should now take all the arguments, not the containing action block.
  4. Blocks no longer need the accept the current user as the first argument. The current user can simply be refered to as user inside the block.
  5. Check if your application rescues Aegis::PermissionError somewhere. That error has been renamed to Aegis::AccessDenied.
  6. Aegis 1 came with many default action aliases like show => read. The only default aliases left are edit => update and new => create. You can define new aliases.
  7. For the sake of consistency, now returns a string instead of a symbol.

If you would like to do something with the old Aegis 1 code, we archived it into the aegis1 branch.

Something went wrong with that request. Please try again.