Class: Tuersteher::PathAccessRule
- Inherits:
-
BaseAccessRule
- Object
- BaseAccessRule
- Tuersteher::PathAccessRule
- Defined in:
- lib/tuersteher.rb
Constant Summary collapse
- METHOD_NAMES =
[:get, :edit, :put, :delete, :post, :all].freeze
Instance Attribute Summary collapse
-
#path_spezification ⇒ Object
readonly
Returns the value of attribute path_spezification.
Attributes inherited from BaseAccessRule
Instance Method Summary collapse
-
#initialize(path) ⇒ PathAccessRule
constructor
Zugriffsregel.
-
#method(http_method) ⇒ Object
set http-methode http_method http-Method, allowed is :get, :put, :delete, :post, :all.
- #to_s ⇒ Object
Methods inherited from BaseAccessRule
#deny, #deny?, #extension, #fired?, #grant, #not, #right, #role, #roles
Constructor Details
#initialize(path) ⇒ PathAccessRule
Zugriffsregel
path :all fuer beliebig, sonst String mit der http-path beginnen muss
665 666 667 668 669 670 671 672 |
# File 'lib/tuersteher.rb', line 665 def initialize(path) raise "wrong path '#{path}'! Must be a String or :all ." unless path==:all or path.is_a?(String) super() if path != :all # :all is only syntax sugar @path_spezification = PathSpecification.new(path, @negation) @rule_spezifications << @path_spezification end end |
Instance Attribute Details
#path_spezification ⇒ Object (readonly)
Returns the value of attribute path_spezification.
659 660 661 |
# File 'lib/tuersteher.rb', line 659 def path_spezification @path_spezification end |
Instance Method Details
#method(http_method) ⇒ Object
set http-methode http_method http-Method, allowed is :get, :put, :delete, :post, :all
677 678 679 680 681 |
# File 'lib/tuersteher.rb', line 677 def method(http_method) raise "wrong method '#{http_method}'! Must be #{METHOD_NAMES.join(', ')} !" unless METHOD_NAMES.include?(http_method) super self end |
#to_s ⇒ Object
683 684 685 |
# File 'lib/tuersteher.rb', line 683 def to_s @_to_s ||= super end |