graphql-authorization 0.0.2 → 0.0.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1f41e83bd1407914b99c2d161cab351389bc2662
4
- data.tar.gz: 5327b6bcf0740340a54d0302c3411e37aba13d04
3
+ metadata.gz: 2d0c19e6a89f5e3f72cfca34ae5477ff167ee387
4
+ data.tar.gz: 76975651d70449d0059b229fa8480538987d77aa
5
5
  SHA512:
6
- metadata.gz: d5c08d15ef43326785b8d84c132f5427aa68de7dcaf8a8bf55232958ab6afd12e6d8d0c22c968dcdf9cfc58139353bc3deac9fcdc974ad990d361946acce94d0
7
- data.tar.gz: 432554dfd539e37283dfa0f120113895e188637de6ecc518406e4b8b46a527b1463f6749a50bc96b3dc6adb901db6b509c573fe86cc7b2d3200a3edb5d58b224
6
+ metadata.gz: 92b9b7a58947c597547fae7413c195db2f43e5a3a21940997b6502be1bec7785f7343a039e3edffa549bc129416b0bcd8965a8222a1606beaea2c1e67d9b255f
7
+ data.tar.gz: 41a46c01cba72be1c7a7bc4c8ae8b27aae284e24b88bd9ab305394f5f462cc6f71983c358cdf4a69e6d2daf7e72be9348f8f1fa331643c5050dce826796f8113
@@ -7,7 +7,7 @@ GraphQL::Authorization::AbilityType = Struct.new("AbilityType", :type, :execute_
7
7
  raise ArgumentError.new "Specifying access on a union type which cannot be accessed"
8
8
  end
9
9
  if value == GraphQL::Authorization::All
10
- self.access type.all_fields.map {|e| e.name.to_sym}, evaluator
10
+ self.access all, evaluator
11
11
  elsif value.class == Array
12
12
  self.access value.map {|e| [e,evaluator]}.to_h
13
13
  elsif value.class != Hash
@@ -16,4 +16,8 @@ GraphQL::Authorization::AbilityType = Struct.new("AbilityType", :type, :execute_
16
16
  self.access_permission = self.access_permission.merge(value)
17
17
  end
18
18
  end
19
+
20
+ def all
21
+ type.all_fields.map {|e| e.name.to_sym}
22
+ end
19
23
  end
@@ -1,5 +1,5 @@
1
1
  module GraphQL
2
2
  module Authorization
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphql-authorization
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Chang
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-09 00:00:00.000000000 Z
11
+ date: 2017-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: graphql
@@ -52,7 +52,6 @@ extensions: []
52
52
  extra_rdoc_files: []
53
53
  files:
54
54
  - MIT-LICENSE
55
- - Rakefile
56
55
  - lib/graphql/authorization.rb
57
56
  - lib/graphql/authorization/ability.rb
58
57
  - lib/graphql/authorization/ability_type.rb
@@ -80,7 +79,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
79
  version: '0'
81
80
  requirements: []
82
81
  rubyforge_project:
83
- rubygems_version: 2.5.1
82
+ rubygems_version: 2.6.10
84
83
  signing_key:
85
84
  specification_version: 4
86
85
  summary: An authorization framework for graphql-ruby
data/Rakefile DELETED
@@ -1,34 +0,0 @@
1
- begin
2
- require 'bundler/setup'
3
- rescue LoadError
4
- puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
- end
6
-
7
- require 'rdoc/task'
8
-
9
- RDoc::Task.new(:rdoc) do |rdoc|
10
- rdoc.rdoc_dir = 'rdoc'
11
- rdoc.title = 'GraphqlAuthorization'
12
- rdoc.options << '--line-numbers'
13
- rdoc.rdoc_files.include('README.rdoc')
14
- rdoc.rdoc_files.include('lib/**/*.rb')
15
- end
16
-
17
-
18
-
19
-
20
-
21
-
22
- Bundler::GemHelper.install_tasks
23
-
24
- require 'rake/testtask'
25
-
26
- Rake::TestTask.new(:test) do |t|
27
- t.libs << 'lib'
28
- t.libs << 'test'
29
- t.pattern = 'test/**/*_test.rb'
30
- t.verbose = false
31
- end
32
-
33
-
34
- task default: :test