-
-
Save anonymous/3ee119a656c001ab08bb0761cd38753e 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 Authz | |
module Authorizable | |
def authorize(method, permission) | |
return if method.nil? || permission.nil? | |
authorizer = Module.new do | |
define_method(method) do |*args, &block| | |
# stuff here... | |
end | |
end | |
prepend authorizer | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment