mumukit-platform 4.0.0 → 4.1.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: 37d749c01796bf6f90b8f862490cfa60ce0ec6f599688c52d7cd67880de8343e
4
- data.tar.gz: b49509bfff79f36916fb9c7ff41742ca8d2b8153b0b4c3ebec6810236f0fc2d8
3
+ metadata.gz: e249892bfa851c6d0a8bf033c1d768452b968f019d27857fc9277ae24a0b2250
4
+ data.tar.gz: 7e31fe679b7dcb8e50fd5d47e874268752240755552baec0446411ebcbab7204
5
5
  SHA512:
6
- metadata.gz: 481bd7a6f8b30aff029a1d812e78d53f4eedd4bbd62320c2e28e134bcf41685b460e4a6692c743229715093ed2ab89a0e038dab97af1cb5cc1c0de529d03413a
7
- data.tar.gz: 4d57b6ba0ae70b58bf6ddd217d87ea84a27d5eb663f90e514ea25dc30689d11a5226525ff7afd97662080c65f244abaeece053e07f72775eec4d6fbaa1ff7fc2
6
+ metadata.gz: 5497d47595b8b810f112759f2fd732240245dc151c1702bd504e6df9c454095925b34e15cf18d7c539bacc15c731f3f8e96e37847e85cb2de66a25aa2e28005c
7
+ data.tar.gz: e2eac480aeb4b9f381c110046a3eb3f9940a210dd19624c1fae2ed7eb4d8b527995c9fd505d66d770b08f3de49926abec9fd01f98a2c664c2a168986c14acb48
@@ -12,6 +12,10 @@ module Mumukit::Platform::Organization
12
12
  Thread.current[:organization] || raise('organization not selected')
13
13
  end
14
14
 
15
+ def self.current?
16
+ !!Thread.current[:organization]
17
+ end
18
+
15
19
  def self.current_locale
16
20
  Thread.current[:organization]&.locale || 'en'
17
21
  end
@@ -2,6 +2,8 @@ module Mumukit::Platform::User::Helpers
2
2
  include Mumukit::Auth::Roles
3
3
  include Mumukit::Platform::Notifiable
4
4
 
5
+ extend Gem::Deprecate
6
+
5
7
  ## Implementors must declare the following methods:
6
8
  #
7
9
  # * permissions
@@ -67,22 +69,28 @@ module Mumukit::Platform::User::Helpers
67
69
 
68
70
  ## Accesible organizations
69
71
 
70
- def accessible_organizations
71
- permissions.accessible_organizations.map do |org|
72
+ def student_granted_organizations
73
+ permissions.student_granted_organizations.map do |org|
72
74
  Mumukit::Platform::Organization.find_by_name!(org) rescue nil
73
75
  end.compact
74
76
  end
75
77
 
76
- def has_accessible_organizations?
77
- accessible_organizations.present?
78
+ def has_student_granted_organizations?
79
+ student_granted_organizations.present?
80
+ end
81
+
82
+ [[:accessible_organizations, :student_granted_organizations],
83
+ [:has_accessible_organizations?, :has_student_granted_organizations?]].each do |it, replacement|
84
+ alias_method it, replacement
85
+ deprecate it, replacement, 2019, 6
78
86
  end
79
87
 
80
88
  def main_organization
81
- accessible_organizations.first
89
+ student_granted_organizations.first
82
90
  end
83
91
 
84
92
  def has_main_organization?
85
- accessible_organizations.length == 1
93
+ student_granted_organizations.length == 1
86
94
  end
87
95
 
88
96
  def has_immersive_main_organization?
@@ -1,5 +1,5 @@
1
1
  module Mumukit
2
2
  module Platform
3
- VERSION = '4.0.0'
3
+ VERSION = '4.1.0'
4
4
  end
5
5
  end
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
23
23
 
24
24
  spec.add_dependency 'mumukit-nuntius', '~> 6.0'
25
25
  spec.add_dependency 'mumukit-core', '~> 1.2'
26
- spec.add_dependency 'mumukit-auth', '~> 7.0'
26
+ spec.add_dependency 'mumukit-auth', '~> 7.6'
27
27
  spec.add_dependency 'mumukit-bridge', '~> 3.5'
28
28
  spec.add_dependency 'activemodel', '>= 4.0'
29
29
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mumukit-platform
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franco Leonardo Bulgarelli
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-11-22 00:00:00.000000000 Z
11
+ date: 2019-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mumukit-nuntius
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '7.0'
47
+ version: '7.6'
48
48
  type: :runtime
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: '7.0'
54
+ version: '7.6'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: mumukit-bridge
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -184,8 +184,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
184
184
  - !ruby/object:Gem::Version
185
185
  version: '0'
186
186
  requirements: []
187
- rubyforge_project:
188
- rubygems_version: 2.7.8
187
+ rubygems_version: 3.0.3
189
188
  signing_key:
190
189
  specification_version: 4
191
190
  summary: Shared Mumuki Platform Components