summaryrefslogtreecommitdiff
path: root/app/controllers/v1/certs_controller.rb
blob: 580c90cf85b96dc230b27e5e45fb66e0d1f9d2db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
class V1::CertsController < ApplicationController

  before_filter :require_eip_access

  # GET /cert
  def show
    @cert = ClientCertificate.new(:prefix => service_level.cert_prefix)
    render text: @cert.to_s, content_type: 'text/plain'
  end

  protected

  def require_eip_access
    access_denied unless service_level.provides?(:eip)
  end

  def service_level
    current_user.effective_service_level
  end
end