Created
October 1, 2011 20:55
-
-
Save isaacsanders/1256649 to your computer and use it in GitHub Desktop.
This is how you give your models easy role and action permissions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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