graphql-authorization 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/graphql/authorization/ability_type.rb +5 -1
- data/lib/graphql/authorization/version.rb +1 -1
- metadata +3 -4
- data/Rakefile +0 -34
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d0c19e6a89f5e3f72cfca34ae5477ff167ee387
|
4
|
+
data.tar.gz: 76975651d70449d0059b229fa8480538987d77aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
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.
|
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-
|
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.
|
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
|