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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 01ac3448d12e710d6fdbd6808f21921969b4fd8ac0cc47627f42143f7956a7a4
4
- data.tar.gz: 527cfc51106410a083b53cdbfe37acf96efa010da457494c877096197ef67f43
3
+ metadata.gz: b28136f7444d373f4ccc47f42df7a2db9f246442b98ccf6dcee5e3810e9ac0d4
4
+ data.tar.gz: be139f64aa104e6d4215d7d0eeb9fc5bcebe3dcecbbe55d96206c22129d88c38
5
5
  SHA512:
6
- metadata.gz: d9c984f5b72789a6891fb4869ca4f870dbb432cd02b7a18885934d118e4385f02f2cfc77d193a41639fd08bf9bb11312d664312a4d9b82d8c316eaacaf93a81f
7
- data.tar.gz: 8cbf58c3622521ae2ca8d3c28d4164f1bb68b32143555ce996ae7312b613f1b92f15982c414beaf49fb30e9d4906e4f140fc15ed1a0b95c76fad23219000ef54
6
+ metadata.gz: bf861defe02dc8b1ec048e76d209ef5469815eb4b96838b8e7400b40e1cd0e62c19297b2a10408c56a14e3ad6a5777303ee49e108b714c63cb2587d6d5ca6b06
7
+ data.tar.gz: 0f6f5b588846e1d73af3df24a3d9244bd682c084530324a18421e0e4b32a03b6c647a252291673bd74c595d6ded71b6ad270382bf0949891fee043547d63d7a0
@@ -41,12 +41,15 @@ module Mumukit::Auth
41
41
  parent :editor
42
42
  end
43
43
  class Editor < Role
44
- parent :owner
44
+ parent :admin
45
45
  end
46
46
  class Janitor < Role
47
- parent :owner
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
@@ -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|
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Mumukit
2
2
  module Auth
3
- VERSION = '7.6.2'
3
+ VERSION = '7.7.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.6.2
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-03-11 00:00:00.000000000 Z
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.3
122
+ rubygems_version: 3.0.4
123
123
  signing_key:
124
124
  specification_version: 4
125
125
  summary: Library for authorizing mumuki requests