mumukit-auth 7.1.0 → 7.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/mumukit/auth/permissions.rb +9 -0
- data/lib/mumukit/auth/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 58505a2138bb6e192ab493e268f4e6d2553bace07c0e32910d6f0f0dc64ad3d5
|
4
|
+
data.tar.gz: 714d15dcc9b2d37efc17479459c45308c3d01d7e36d941784a15f0859cea42e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b95000d71d18d3222103bef492dfe0c933f92f4116c6ffdc6d7cd2947863616e9bff8437f97d58ddb9bc106c7f436516977884c5c2ed49265bd03502081925f
|
7
|
+
data.tar.gz: 863d6d8233f62803b71dba8f943fc7c21e89a8200b01552177dcc0d09e868d2ecc05695ad345eb402029d7980cc515969b98638957e4542c52a8c09633e05a1e
|
@@ -79,6 +79,15 @@ class Mumukit::Auth::Permissions
|
|
79
79
|
permission.to_json
|
80
80
|
end
|
81
81
|
|
82
|
+
def assign_to?(other, previous)
|
83
|
+
diff = previous.as_set ^ other.as_set
|
84
|
+
diff.all? { |role, grant| has_permission?(role, grant) }
|
85
|
+
end
|
86
|
+
|
87
|
+
def as_set
|
88
|
+
Set.new scopes.flat_map { |role, scope| scope.grants.map {|grant| [role, grant]} }
|
89
|
+
end
|
90
|
+
|
82
91
|
private
|
83
92
|
|
84
93
|
def has_all_permissions?(role, scope)
|
data/lib/mumukit/auth/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mumukit-auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.
|
4
|
+
version: 7.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Franco Leonardo Bulgarelli
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -56,16 +56,16 @@ dependencies:
|
|
56
56
|
name: jwt
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '1.5'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '1.5'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: mumukit-core
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -120,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
120
|
version: '0'
|
121
121
|
requirements: []
|
122
122
|
rubyforge_project:
|
123
|
-
rubygems_version: 2.4
|
123
|
+
rubygems_version: 2.7.4
|
124
124
|
signing_key:
|
125
125
|
specification_version: 4
|
126
126
|
summary: Library for authorizing mumuki requests
|