mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 09:57:23 +02:00
Merge updates and fixes
This commit is contained in:
parent
96d1c60dd8
commit
2e47bcf5cb
4 changed files with 9 additions and 11 deletions
|
@ -15,14 +15,6 @@ class ApplicationController < ActionController::Base
|
||||||
redirect_to admin_dashboard_path, alert: exception.message
|
redirect_to admin_dashboard_path, alert: exception.message
|
||||||
end
|
end
|
||||||
|
|
||||||
def current_ability
|
|
||||||
if defined?(current_api_user) && current_api_user.present?
|
|
||||||
current_api_user.ability
|
|
||||||
else
|
|
||||||
current_user.ability
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def after_sign_in_path_for(_resource)
|
def after_sign_in_path_for(_resource)
|
||||||
if session[:user_return_to] && session[:user_return_to] != login_path
|
if session[:user_return_to] && session[:user_return_to] != login_path
|
||||||
return session[:user_return_to].to_s
|
return session[:user_return_to].to_s
|
||||||
|
|
|
@ -208,7 +208,7 @@ class Epp::DomainsController < EppController
|
||||||
|
|
||||||
return domain if domain.auth_info == params[:parsed_frame].css('authInfo pw').text
|
return domain if domain.auth_info == params[:parsed_frame].css('authInfo pw').text
|
||||||
|
|
||||||
if (domain.registrar != current_api_user.registrar) && secure[:secure] == true
|
if (domain.registrar != current_user.registrar) && secure[:secure] == true
|
||||||
epp_errors << {
|
epp_errors << {
|
||||||
code: '2302',
|
code: '2302',
|
||||||
msg: I18n.t('errors.messages.domain_exists_but_belongs_to_other_registrar'),
|
msg: I18n.t('errors.messages.domain_exists_but_belongs_to_other_registrar'),
|
||||||
|
|
|
@ -5,7 +5,13 @@ class Ability
|
||||||
alias_action :show, :create, :update, :destroy, to: :crud
|
alias_action :show, :create, :update, :destroy, to: :crud
|
||||||
|
|
||||||
@user = user || AdminUser.new
|
@user = user || AdminUser.new
|
||||||
|
|
||||||
|
case @user.class.to_s
|
||||||
|
when 'AdminUser'
|
||||||
@user.roles.each { |role| send(role) } if @user.roles
|
@user.roles.each { |role| send(role) } if @user.roles
|
||||||
|
when 'ApiUser'
|
||||||
|
epp
|
||||||
|
end
|
||||||
|
|
||||||
can :show, :dashboard
|
can :show, :dashboard
|
||||||
end
|
end
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(version: 20150212125339) do
|
ActiveRecord::Schema.define(version: 20150213104014) do
|
||||||
|
|
||||||
# These are extensions that must be enabled in order to support this database
|
# These are extensions that must be enabled in order to support this database
|
||||||
enable_extension "plpgsql"
|
enable_extension "plpgsql"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue