mirror of
https://github.com/internetee/registry.git
synced 2025-08-03 00:12:03 +02:00
Merge branch 'master' of github.com:internetee/registry
Conflicts: db/schema.rb
This commit is contained in:
commit
641522ff08
31 changed files with 513 additions and 30 deletions
|
@ -4,9 +4,13 @@ class Ability
|
|||
def initialize(user)
|
||||
|
||||
# user ||= EppUser.last
|
||||
|
||||
can :read, DomainTransfer, transfer_to_id: user.registrar.id
|
||||
can :approve_as_client, DomainTransfer, transfer_from_id: user.registrar.id, status: DomainTransfer::PENDING
|
||||
if user.admin?
|
||||
can :manage, Domain
|
||||
else
|
||||
can :manage, Domain, registrar_id: user.registrar.id
|
||||
can :read, DomainTransfer, transfer_to_id: user.registrar.id
|
||||
can :approve_as_client, DomainTransfer, transfer_from_id: user.registrar.id, status: DomainTransfer::PENDING
|
||||
end
|
||||
# Define abilities for the passed in user here. For example:
|
||||
#
|
||||
# user ||= User.new # guest user (not logged in)
|
||||
|
|
|
@ -3,6 +3,7 @@ class Registrar < ActiveRecord::Base
|
|||
has_many :domains
|
||||
has_many :ns_sets
|
||||
has_many :epp_users
|
||||
has_many :users
|
||||
has_many :domain_transfers, foreign_key: 'transfer_to_id'
|
||||
|
||||
def to_s
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
class User < ActiveRecord::Base
|
||||
# Include default devise modules. Others available are:
|
||||
# :confirmable, :lockable, :timeoutable and :omniauthable
|
||||
devise :trackable, :timeoutable
|
||||
# TODO Foreign user will get email with activation link,email,temp-password.
|
||||
# After activisation, system should require to change temp password.
|
||||
# TODO Estonian id validation
|
||||
|
||||
belongs_to :role
|
||||
belongs_to :registrar
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue