mirror of
https://github.com/internetee/registry.git
synced 2025-07-25 03:58:27 +02:00
Context switching for client
This commit is contained in:
parent
5dfee40b87
commit
b48b91878d
9 changed files with 44 additions and 12 deletions
|
@ -3,9 +3,14 @@ class Ability
|
|||
|
||||
def initialize(user)
|
||||
|
||||
alias_action :create, :read, :update, :destroy, :to => :crud
|
||||
|
||||
user ||= User.new
|
||||
if user.admin?
|
||||
can :manage, Domain
|
||||
can :switch, :registrar
|
||||
can :crud, DomainTransfer
|
||||
can :approve_as_client, DomainTransfer, status: DomainTransfer::PENDING
|
||||
elsif user.persisted?
|
||||
can :manage, Domain, registrar_id: user.registrar.id
|
||||
can :read, DomainTransfer, transfer_to_id: user.registrar.id
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue