Skip to content

Instantly share code, notes, and snippets.

@isaacsanders
Created October 2, 2011 03:21
Show Gist options
  • Save isaacsanders/1256983 to your computer and use it in GitHub Desktop.
Save isaacsanders/1256983 to your computer and use it in GitHub Desktop.
For Jon Hogue
class User
include ReUser
roles do
role :god do |r|
r.action :manage_all
r.aciton :new_user_session
r.action :create_user_session
r.action :destroy_user_session
end
role :registrant {|r| r.action :read_event}
role :observer {|r| action :read_event}
role :admin {|r| action :manage_event}
mail_actions = lambda do |r|
r.action :show_user
r.action :read_todo
r.action :box_mail
r.action :show_mail
end
role :teacher mail_actions
role :student mail_actions
end
def initialize(role)
@role = role
end
# More User stuff
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment