Add more auth methods

This commit is contained in:
Martin Lensment 2015-03-10 11:17:57 +02:00
parent d1ec91323b
commit 6352c23cf1
2 changed files with 5 additions and 0 deletions

View file

@ -5,6 +5,7 @@ class Epp::DomainsController < EppController
before_action :find_password, only: [:info]
def create
authorize! :create, Epp::EppDomain
@domain = Epp::EppDomain.new_from_epp(params[:parsed_frame], current_user)
if @domain.errors.any? || !@domain.save
@ -20,6 +21,8 @@ class Epp::DomainsController < EppController
end
def check
authorize! :check, Epp::EppDomain
names = params[:parsed_frame].css('name').map(&:text)
@domains = Epp::EppDomain.check_availability(names)
render_epp_response '/epp/domains/check'