-
Notifications
You must be signed in to change notification settings - Fork 43
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
[MNOE-360] - add flag for impersonating #239
Conversation
@@ -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) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
scope.impersonation_enabled
Also add the default to the generator template: |
117b170
to
6c79290
Compare
Rails.application.reload_routes! | ||
end | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty line
6c79290
to
2e2de1a
Compare
…-config [MNOE-448][MNOE-449] Theme previewer dynamic config
@ouranos I am missing the spec for this. Cant find how to set a flag...