2014-02-17 18:05:39 +01:00
|
|
|
module ApiKeys
|
2014-06-29 22:21:27 +02:00
|
|
|
def api_index(channel_id)
|
2014-02-17 18:05:39 +01:00
|
|
|
if current_user && !current_user.channels.find_by_id(channel_id).nil?
|
|
|
|
@channel = current_user.channels.find(channel_id)
|
|
|
|
end
|
2014-06-29 22:21:27 +02:00
|
|
|
if current_user.present? && @channel.present? && current_user.id == @channel.user_id
|
2014-02-17 18:05:39 +01:00
|
|
|
@write_key = @channel.api_keys.write_keys.first
|
|
|
|
@read_keys = @channel.api_keys.read_keys
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2014-06-29 22:21:27 +02:00
|
|
|
|