Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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