Sha256: 5a2aedec3d8455d36e704fafb946600fbeee8577aede9859ee57a629c50f4f32
Contents?: true
Size: 835 Bytes
Versions: 1
Compression:
Stored size: 835 Bytes
Contents
module CanTango module PermissionEngine module Parser autoload_modules :Categories, :Permissions autoload_modules :Category, :Default, :Ownership, :Relationship, :Regex, :Rule def self.create_for method, action, target type = parser_type target parser_name = "CanTango::PermissionEngine::Parser::#{type.to_s.camelize}" parser_class = parser_name.constantize parser_class.new method, action, target end protected def self.parser_type target case target.to_s when /\/(.*)\// :regex when /^\^(\w+)/ # a category is prefixed with a '^<D-^>s' :category when /\w+#\w+=.+/ :relationship when /\w+#\w+/ :ownership else :default end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
cantango-0.8.0 | lib/cantango/permission_engine/parser.rb |