access_schema 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@ module AccessSchema
2
2
  class Assert
3
3
  attr_reader :name
4
4
 
5
- def initialize(name, vars, &block)
5
+ def initialize(name, vars = [], &block)
6
6
  @name = name
7
7
  @block = block
8
8
  vars << :subject unless vars.include?(:subject)
@@ -4,7 +4,7 @@ module AccessSchema
4
4
  attr_reader :roles
5
5
  attr_reader :options
6
6
 
7
- def initialize(name, roles, options)
7
+ def initialize(name, roles, options = {})
8
8
  @name = name
9
9
  @roles = roles
10
10
  @options = options
@@ -37,7 +37,6 @@ module AccessSchema
37
37
  private
38
38
 
39
39
  def normalize_args(args)
40
- #Rails.logger.debug("schema normalize args: #{args.inspect}")
41
40
 
42
41
  options = args.last.is_a?(Hash) ? args.pop : {}
43
42
  roles = args[2]
@@ -56,7 +55,6 @@ module AccessSchema
56
55
  end
57
56
 
58
57
  def check!(namespace_name, element_name, roles, options)
59
- #Rails.logger.debug [namespace_name, element_name, roles, options].inspect
60
58
  allowed = for_element(namespace_name, element_name) do |element|
61
59
  element.allow?(roles) do |expectation|
62
60
  check_assert(expectation, options)
@@ -1,3 +1,3 @@
1
1
  module AccessSchema
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: access_schema
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: