mumukit-auth 7.7.0 → 7.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b28136f7444d373f4ccc47f42df7a2db9f246442b98ccf6dcee5e3810e9ac0d4
4
- data.tar.gz: be139f64aa104e6d4215d7d0eeb9fc5bcebe3dcecbbe55d96206c22129d88c38
3
+ metadata.gz: d04c848d1712ad910c8bee65a29e7c97cc9473e6bd355a239da5ae4779a628a3
4
+ data.tar.gz: 1ce6ae321c42896e72cc1bef840a7d8b38eb2ddcd9eab4f422a32b252daf67b3
5
5
  SHA512:
6
- metadata.gz: bf861defe02dc8b1ec048e76d209ef5469815eb4b96838b8e7400b40e1cd0e62c19297b2a10408c56a14e3ad6a5777303ee49e108b714c63cb2587d6d5ca6b06
7
- data.tar.gz: 0f6f5b588846e1d73af3df24a3d9244bd682c084530324a18421e0e4b32a03b6c647a252291673bd74c595d6ded71b6ad270382bf0949891fee043547d63d7a0
6
+ metadata.gz: 3b47da935941edca52ea4be8fe3fe9a3e87a10f6f90fcd132683655aece5d35f359bb51c347dfeb068df92eb64bc13745851e0636f28e8c6c3ad69449392e550
7
+ data.tar.gz: ff30972e250e1427bb40a6a585ff8b3be581896054cd34dce36859d7e30ede4d585be856b2a77dce26186179cdc513e068726c39d30d9c4e33faead47e352314
@@ -7,6 +7,8 @@ end
7
7
 
8
8
  module Mumukit::Auth
9
9
  class Grant
10
+ delegate :organization, to: :to_mumukit_slug
11
+
10
12
  def as_json(options={})
11
13
  to_s
12
14
  end
@@ -41,8 +41,12 @@ class Mumukit::Auth::Permissions
41
41
  granted_organizations_for :student
42
42
  end
43
43
 
44
+ def any_granted_organizations
45
+ scopes.values.flat_map(&:grants).map(&:organization).to_set
46
+ end
47
+
44
48
  def granted_organizations_for(role)
45
- scope_for(role)&.grants&.map { |grant| grant.to_mumukit_slug.organization }.to_set
49
+ scope_for(role)&.grants&.map(&:organization).to_set
46
50
  end
47
51
 
48
52
  def add_permission!(role, *grants)
@@ -1,5 +1,5 @@
1
1
  module Mumukit
2
2
  module Auth
3
- VERSION = '7.7.0'
3
+ VERSION = '7.8.0'
4
4
  end
5
5
  end
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.7.0
4
+ version: 7.8.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: 2019-06-21 00:00:00.000000000 Z
11
+ date: 2020-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,42 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.7'
19
+ version: '2.0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.7'
26
+ version: '2.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: '12.3'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: '12.3'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '2'
47
+ version: '3.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '2'
54
+ version: '3.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: jwt
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -119,7 +119,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
119
  - !ruby/object:Gem::Version
120
120
  version: '0'
121
121
  requirements: []
122
- rubygems_version: 3.0.4
122
+ rubyforge_project:
123
+ rubygems_version: 2.7.7
123
124
  signing_key:
124
125
  specification_version: 4
125
126
  summary: Library for authorizing mumuki requests