Class: Mumukit::Auth::SingleGrant
- Inherits:
-
Grant
- Object
- Grant
- Mumukit::Auth::SingleGrant
show all
- Defined in:
- lib/mumukit/auth/grant.rb
Instance Method Summary
collapse
Methods inherited from Grant
#==, #as_json, #hash, #inspect, parse, #to_mumukit_grant
Constructor Details
Returns a new instance of SingleGrant.
79
80
81
|
# File 'lib/mumukit/auth/grant.rb', line 79
def initialize(slug)
@slug = slug.normalize
end
|
Instance Method Details
#allows?(resource_slug) ⇒ Boolean
83
84
85
86
|
# File 'lib/mumukit/auth/grant.rb', line 83
def allows?(resource_slug)
resource_slug = resource_slug.to_mumukit_slug.normalize!
resource_slug.match_first(@slug.first) && resource_slug.match_second(@slug.second)
end
|
#to_mumukit_slug ⇒ Object
92
93
94
|
# File 'lib/mumukit/auth/grant.rb', line 92
def to_mumukit_slug
@slug
end
|
#to_s ⇒ Object
88
89
90
|
# File 'lib/mumukit/auth/grant.rb', line 88
def to_s
@slug.to_s
end
|