Skip to content

Instantly share code, notes, and snippets.

@isaacsanders
Created October 1, 2011 20:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save isaacsanders/1256649 to your computer and use it in GitHub Desktop.
Save isaacsanders/1256649 to your computer and use it in GitHub Desktop.
This is how you give your models easy role and action permissions.
require 'reuse'
class User
include ReUser
roles do
role(:admin) {|r| r.actions(:read, :write, :execute)}
role(:user) {|r| r.action(:read)}
default :user
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment