Class: Mumukit::Auth::OrgGrant

Inherits:
Grant
  • Object
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

Returns:

  • (Boolean)


68
69
70
# File 'lib/mumukit/auth/grant.rb', line 68

def access?(organization)
  @org == organization
end

#allows?(slug) ⇒ Boolean

Returns:

  • (Boolean)


64
65
66
# File 'lib/mumukit/auth/grant.rb', line 64

def allows?(slug)
  /^#{@org}\/.*/.matches? slug
end

#to_sObject



72
73
74
# File 'lib/mumukit/auth/grant.rb', line 72

def to_s
  "#{@org}/*"
end