Created
July 1, 2009 23:12
-
-
Save ahawkins/139143 to your computer and use it in GitHub Desktop.
This file contains 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
module KeepUp | |
module Permissions | |
module RoleExtension | |
def self.included(klass) | |
klass.class_eval do | |
include KeepUp::Permissions::CommonMethods | |
include KeepUp::Permissions::Language | |
has_and_belongs_to_many :users, :join_table => :user_roles | |
has_one :permission, :as => :authorizable | |
alias :has_permission? :has_local_permission? | |
alias :can? :has_local_permission? | |
after_create :create_permission | |
accepts_nested_attributes_for :permission | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment