Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MNOE-360] - add flag for impersonating #239

Merged
merged 2 commits into from
Mar 2, 2017

Conversation

clemoberti
Copy link
Contributor

@ouranos I am missing the spec for this. Cant find how to set a flag...

@@ -10,7 +10,7 @@ class ImpersonateController < ApplicationController
def create
session[:impersonator_redirect_path] = params[:redirect_path].presence
@user = MnoEnterprise::User.find(params[:user_id])
if @user.present?
if @user.present? && (!Settings.admin_panel || !Settings.admin_panel.impersonation.disabled)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of disabling it in the controller, you can disable it at the route level:

unless Settings.try(:admin_panel).try(:impersonation).try(:disabled)
  get "/impersonate/user/:user_id", to: "impersonate#create", as: :impersonate_user
  get "/impersonate/revert", to: "impersonate#destroy", as: :revert_impersonate_user
end

@@ -15,6 +15,7 @@
displayList: []
widgetTitle: 'Loading users...'
search: ''
scope.disable_impersonation = ADMIN_PANEL_CONFIG.impersonation.disabled if ADMIN_PANEL_CONFIG.impersonation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scope.impersonation_enabled

'ngInject'
vm = this

vm.disable_impersonation = ADMIN_PANEL_CONFIG.impersonation.disabled if ADMIN_PANEL_CONFIG.impersonation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scope.impersonation_enabled

@ouranos
Copy link
Contributor

ouranos commented Mar 2, 2017

Also add the default to the generator template: /core/lib/generators/mno_enterprise/install/templates/config/settings.yml

@clemoberti clemoberti force-pushed the 360_add_flag_for_impersonating branch 2 times, most recently from 117b170 to 6c79290 Compare March 2, 2017 02:38
Rails.application.reload_routes!
end


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty line

@clemoberti clemoberti force-pushed the 360_add_flag_for_impersonating branch from 6c79290 to 2e2de1a Compare March 2, 2017 02:42
@ouranos ouranos merged commit a135c58 into maestrano:master Mar 2, 2017
@clemoberti clemoberti deleted the 360_add_flag_for_impersonating branch March 2, 2017 04:16
aluqueGH pushed a commit to aluqueGH/mno-enterprise that referenced this pull request Jul 10, 2018
…-config

[MNOE-448][MNOE-449] Theme previewer dynamic config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants