mumukit-auth 7.6.2 → 7.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mumukit/auth/role.rb +6 -3
- data/lib/mumukit/auth/roles.rb +1 -1
- data/lib/mumukit/auth/slug.rb +1 -1
- data/lib/mumukit/auth/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b28136f7444d373f4ccc47f42df7a2db9f246442b98ccf6dcee5e3810e9ac0d4
|
4
|
+
data.tar.gz: be139f64aa104e6d4215d7d0eeb9fc5bcebe3dcecbbe55d96206c22129d88c38
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf861defe02dc8b1ec048e76d209ef5469815eb4b96838b8e7400b40e1cd0e62c19297b2a10408c56a14e3ad6a5777303ee49e108b714c63cb2587d6d5ca6b06
|
7
|
+
data.tar.gz: 0f6f5b588846e1d73af3df24a3d9244bd682c084530324a18421e0e4b32a03b6c647a252291673bd74c595d6ded71b6ad270382bf0949891fee043547d63d7a0
|
data/lib/mumukit/auth/role.rb
CHANGED
@@ -41,12 +41,15 @@ module Mumukit::Auth
|
|
41
41
|
parent :editor
|
42
42
|
end
|
43
43
|
class Editor < Role
|
44
|
-
parent :
|
44
|
+
parent :admin
|
45
45
|
end
|
46
46
|
class Janitor < Role
|
47
|
-
parent :
|
47
|
+
parent :admin
|
48
48
|
end
|
49
49
|
class Moderator < Role
|
50
|
+
parent :admin
|
51
|
+
end
|
52
|
+
class Admin < Role
|
50
53
|
parent :owner
|
51
54
|
end
|
52
55
|
class Owner < Role
|
@@ -57,4 +60,4 @@ module Mumukit::Auth
|
|
57
60
|
end
|
58
61
|
end
|
59
62
|
end
|
60
|
-
end
|
63
|
+
end
|
data/lib/mumukit/auth/roles.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Mumukit::Auth
|
2
2
|
module Roles
|
3
|
-
ROLES = [:student, :teacher, :headmaster, :writer, :editor, :janitor, :moderator, :owner]
|
3
|
+
ROLES = [:student, :teacher, :headmaster, :writer, :editor, :janitor, :moderator, :admin, :owner]
|
4
4
|
|
5
5
|
ROLES.each do |role|
|
6
6
|
define_method "#{role}?" do |scope = Mumukit::Auth::Slug.any|
|
data/lib/mumukit/auth/slug.rb
CHANGED
@@ -113,7 +113,7 @@ module Mumukit::Auth
|
|
113
113
|
end
|
114
114
|
|
115
115
|
def self.validate_slug!(slug)
|
116
|
-
unless slug =~
|
116
|
+
unless slug =~ /\A[^\/\n]+\/[^\/\n]+\z/
|
117
117
|
raise Mumukit::Auth::InvalidSlugFormatError, "Invalid slug: #{slug}. It must be in first/second format"
|
118
118
|
end
|
119
119
|
end
|
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.7.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-
|
11
|
+
date: 2019-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -119,7 +119,7 @@ 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.
|
122
|
+
rubygems_version: 3.0.4
|
123
123
|
signing_key:
|
124
124
|
specification_version: 4
|
125
125
|
summary: Library for authorizing mumuki requests
|