Add ability for admin to remove registry lock

This commit is contained in:
Maciej Szlosarczyk 2018-08-08 15:43:29 +03:00
parent 4743b1e2a5
commit dffe865d89
No known key found for this signature in database
GPG key ID: 41D62D42D3B0D765
10 changed files with 174 additions and 29 deletions

View file

@ -0,0 +1,22 @@
module Admin
module Domains
class RegistryLockController < BaseController
def destroy
set_domain
authorize! :manage, @domain
if @domain.remove_registry_lock
redirect_to edit_admin_domain_url(@domain), notice: t('admin.domains.registry_lock_delete.success')
else
redirect_to edit_admin_domain_url(@domain), alert: t('admin.domains.registry_lock_delete.error')
end
end
private
def set_domain
@domain = Domain.find(params[:domain_id])
end
end
end
end