gitlab-org--gitlab-foss/lib/mattermost/team.rb

18 lines
411 B
Ruby
Raw Normal View History

module Mattermost
2016-12-15 14:19:42 -05:00
class Team < Session
def self.team_admin
body = get('/users/initial_load').parsed_response
return [] unless body['team_members']
team_ids = body['team_members'].map do |team|
team['team_id'] if team['roles'].split.include?('team_admin')
end.compact
body['teams'].select do |team|
team_ids.include?(team['id'])
end
end
end
end