Added Registrar roles with super, epp, billing

This commit is contained in:
Priit Tark 2015-05-20 19:58:00 +03:00
parent 8371dcf46e
commit 5afa0ac793
12 changed files with 77 additions and 24 deletions

View file

@ -15,11 +15,13 @@ class ApiUser < User
belongs_to :registrar
has_many :certificates
validates :username, :password, :registrar, presence: true
validates :username, :password, :registrar, :roles, presence: true
validates :username, uniqueness: true
attr_accessor :registrar_typeahead
ROLES = %w(super epp billing) # should not match to admin roles
def ability
@ability ||= Ability.new(self)
end