Add new resource for certs

This commit is contained in:
Martin Lensment 2015-02-25 16:26:09 +02:00
parent 143fb7eb1b
commit 5319db16b4
12 changed files with 310 additions and 33 deletions

View file

@ -5,7 +5,7 @@ class Ability
alias_action :show, :create, :update, :destroy, to: :crud
@user = user || AdminUser.new
case @user.class.to_s
when 'AdminUser'
@user.roles.each { |role| send(role) } if @user.roles
@ -18,11 +18,11 @@ class Ability
def epp
# Epp::Contact
can(:info, Epp::Contact) { |c, pw| c.registrar_id == @user.registrar_id || c.auth_info == pw }
can(:info, Epp::Contact) { |c, pw| c.registrar_id == @user.registrar_id || c.auth_info == pw }
can(:check, Epp::Contact)
can(:create, Epp::Contact)
can(:update, Epp::Contact) { |c, pw| c.registrar_id == @user.registrar_id && c.auth_info == pw }
can(:delete, Epp::Contact) { |c, pw| c.registrar_id == @user.registrar_id && c.auth_info == pw }
can(:update, Epp::Contact) { |c, pw| c.registrar_id == @user.registrar_id && c.auth_info == pw }
can(:delete, Epp::Contact) { |c, pw| c.registrar_id == @user.registrar_id && c.auth_info == pw }
can(:renew, Epp::Contact)
can(:view_password, Epp::Contact) { |c| c.registrar_id == @user.registrar_id }
end
@ -45,6 +45,7 @@ class Ability
can :manage, DomainVersion
can :manage, User
can :manage, ApiUser
can :manage, Certificate
can :manage, Keyrelay
can :manage, LegalDocument
can :read, ApiLog::EppLog