mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 17:59:47 +02:00
Merge branch 'master' of github.com:internetee/registry
This commit is contained in:
commit
7df902a543
2 changed files with 17 additions and 5 deletions
|
@ -6,7 +6,15 @@ class Ability
|
|||
alias_action :create, :read, :update, :destroy, :to => :crud
|
||||
|
||||
user ||= User.new
|
||||
if Rails.env.development? || Rails.env.test? || (REGISTRY_ENV == :admin && user.admin?)
|
||||
|
||||
# public user abilites
|
||||
can :create, :session
|
||||
|
||||
if REGISTRY_ENV == :admin
|
||||
can :create, :admin_session
|
||||
end
|
||||
|
||||
if (Rails.env.production? ? REGISTRY_ENV == :admin && user.admin? : user.admin?)
|
||||
can :manage, Domain
|
||||
can :switch, :registrar
|
||||
can :crud, DomainTransfer
|
||||
|
@ -15,8 +23,10 @@ class Ability
|
|||
can :manage, Domain, registrar_id: user.registrar.id
|
||||
can :read, DomainTransfer, transfer_to_id: user.registrar.id
|
||||
can :read, DomainTransfer, transfer_from_id: user.registrar.id
|
||||
can :approve_as_client, DomainTransfer, transfer_from_id: user.registrar.id, status: DomainTransfer::PENDING
|
||||
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)
|
||||
|
|
|
@ -21,6 +21,8 @@
|
|||
%h2.form-signin-heading.text-center Eesti Interneti SA
|
||||
%hr
|
||||
/ TODO: Refactor this when ID card login is done
|
||||
= button_to 'ID card (gitlab)', 'sessions', class: 'btn btn-lg btn-primary btn-block', name: 'gitlab'
|
||||
= button_to 'ID card (zone)', 'sessions', class: 'btn btn-lg btn-primary btn-block', name: 'zone'
|
||||
= button_to 'ID card (elkdata)', 'sessions', class: 'btn btn-lg btn-primary btn-block', name: 'elkdata'
|
||||
- if Rails.env.development? || (can? :create, :admin_session)
|
||||
= button_to 'ID card (gitlab)', 'sessions', class: 'btn btn-lg btn-primary btn-block', name: 'gitlab'
|
||||
- if can? :create, :session
|
||||
= button_to 'ID card (zone)', 'sessions', class: 'btn btn-lg btn-primary btn-block', name: 'zone'
|
||||
= button_to 'ID card (elkdata)', 'sessions', class: 'btn btn-lg btn-primary btn-block', name: 'elkdata'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue