class V1::SmtpCertsController < ApplicationController before_filter :require_login before_filter :require_email_account before_filter :fetch_identity # GET /1/smtp_cert def show @cert = ClientCertificate.new prefix: current_user.email_address @identity.register_cert(@cert) @identity.save render text: @cert.to_s, content_type: 'text/plain' end protected # # Filters # def require_email_account access_denied unless service_level.provides? 'email' end def fetch_identity @identity = current_user.identity end # # Helper methods # def service_level current_user.effective_service_level end end