Class: Mumukit::Auth::OrgGrant
- Inherits:
-
Grant
- Object
- Grant
- Mumukit::Auth::OrgGrant
show all
- Defined in:
- lib/mumukit/auth/grant.rb
Instance Method Summary
collapse
Methods inherited from Grant
#[], #as_json, parse, slug?
Constructor Details
#initialize(org) ⇒ OrgGrant
Returns a new instance of OrgGrant.
60
61
62
|
# File 'lib/mumukit/auth/grant.rb', line 60
def initialize(org)
@org = org
end
|
Instance Method Details
#access?(organization) ⇒ Boolean
68
69
70
|
# File 'lib/mumukit/auth/grant.rb', line 68
def access?(organization)
@org == organization
end
|
#allows?(slug) ⇒ Boolean
64
65
66
|
# File 'lib/mumukit/auth/grant.rb', line 64
def allows?(slug)
/^#{@org}\/.*/.matches? slug
end
|
#to_s ⇒ Object
72
73
74
|
# File 'lib/mumukit/auth/grant.rb', line 72
def to_s
"#{@org}/*"
end
|