mumukit-platform 4.1.0 → 4.2.0
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
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a9debde5cab571898e9f88dd89a6f6800dfc9a1549ae00fc5d84792aa15cdc17
|
|
4
|
+
data.tar.gz: 6eae2161b167142e81ea81920316d3ec68e394545c0b0952fd8c5ec5606f22b1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ff19191a1dbca41064ecf36df3e0e945546ad30a179a53bd3f763552c86cb65e9ccb8819f755c7b1fff5bedc0571c7ef25bb8eb2eecb5f734c47184567e926d4
|
|
7
|
+
data.tar.gz: a76f6ca3e5b593d77f748e9205503d2986808eade31f2207e7e30ffdf880b027237e69d18245d1b5e2f8972fb8d2884cf1e31cbf8160f4561a6c2f2aaadb86ea
|
|
@@ -2,6 +2,7 @@ class Mumukit::Platform::Organization::Settings < Mumukit::Platform::Model
|
|
|
2
2
|
model_attr_accessor :login_methods,
|
|
3
3
|
:login_provider,
|
|
4
4
|
:login_provider_settings,
|
|
5
|
+
:forum_discussions_minimal_role,
|
|
5
6
|
:raise_hand_enabled?,
|
|
6
7
|
:feedback_suggestions_enabled?,
|
|
7
8
|
:public?,
|
|
@@ -17,4 +18,8 @@ class Mumukit::Platform::Organization::Settings < Mumukit::Platform::Model
|
|
|
17
18
|
def login_methods
|
|
18
19
|
@login_methods ||= ['user_pass']
|
|
19
20
|
end
|
|
21
|
+
|
|
22
|
+
def forum_discussions_minimal_role
|
|
23
|
+
(@forum_discussions_minimal_role || 'student').to_sym
|
|
24
|
+
end
|
|
20
25
|
end
|
|
@@ -34,21 +34,36 @@ module Mumukit::Platform::User::Helpers
|
|
|
34
34
|
self.permissions = permissions.merge(new_permissions)
|
|
35
35
|
end
|
|
36
36
|
|
|
37
|
-
[:
|
|
37
|
+
(Mumukit::Auth::Roles::ROLES - [:writer, :editor, :owner] + [:discusser]).each do |role|
|
|
38
38
|
role_of = "#{role}_of?"
|
|
39
39
|
role_here = "#{role}_here?"
|
|
40
40
|
|
|
41
|
+
# Tells whether this user has #{role} permissions in
|
|
42
|
+
# the given organization
|
|
41
43
|
define_method role_of do |organization|
|
|
42
44
|
has_permission? role, organization.slug
|
|
43
45
|
end
|
|
44
46
|
|
|
47
|
+
# Tells whether this user has #{role} permissions in
|
|
48
|
+
# the current organization
|
|
45
49
|
define_method role_here do
|
|
46
50
|
send role_of, Mumukit::Platform::Organization.current
|
|
47
51
|
end
|
|
48
52
|
end
|
|
49
53
|
|
|
50
|
-
|
|
51
|
-
|
|
54
|
+
# Tells whether this user has forum discusser permissions in
|
|
55
|
+
# the given organization
|
|
56
|
+
def discusser_of?(organization)
|
|
57
|
+
has_permission? organization.forum_discussions_minimal_role, organization.slug
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
(Mumukit::Auth::Roles::ROLES - [:owner]).each do |role|
|
|
61
|
+
|
|
62
|
+
# Assignes the #{role} role to this user
|
|
63
|
+
# for the given slug
|
|
64
|
+
define_method "make_#{role}_of!" do |slug|
|
|
65
|
+
add_permission! role, slug
|
|
66
|
+
end
|
|
52
67
|
end
|
|
53
68
|
|
|
54
69
|
## Profile
|
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.
|
|
4
|
+
version: 4.2.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: 2019-
|
|
11
|
+
date: 2019-04-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: mumukit-nuntius
|