Class: Bosh::Director::Models::Team

Inherits:
Object
  • Object
show all
Defined in:
lib/bosh/director/models/team.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.transform_admin_team_scope_to_teams(token_scopes) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/bosh/director/models/team.rb', line 9

def self.transform_admin_team_scope_to_teams(token_scopes)
  return [] if token_scopes.nil?
  team_scopes = token_scopes.map do |scope|
    match = scope.match(/\Abosh\.teams\.([^\.]*)\.admin\z/)
    match[1] unless match.nil?
  end
  team_names = team_scopes.compact
  team_names.map do |name|
    create_or_find(name)
  end
end

Instance Method Details

#validateObject



5
6
7
# File 'lib/bosh/director/models/team.rb', line 5

def validate
  validates_presence [:name]
end