1 /*
  2  * Copyright (c) 2015-2017 LabKey Corporation
  3  *
  4  * Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
  5  */
  6 LABKEY.Security = new function(impl) {
  7 
  8     /**
  9      * @private
 10      */
 11     impl.Impersonation = new function() {
 12 
 13         // Helper for lazy initializing impersonation dependencies
 14         var _display = function(componentName)
 15         {
 16             LABKEY.requiresExt4ClientAPI(function() {
 17                 LABKEY.requiresScript('Impersonate.js', function() {
 18                     Ext4.onReady(function() {
 19                         Ext4.create(componentName).show();
 20                     });
 21                 });
 22             });
 23         };
 24 
 25         return {
 26             showImpersonateUser: function() { _display('LABKEY.Security.ImpersonateUser'); },
 27             showImpersonateGroup: function() { _display('LABKEY.Security.ImpersonateGroup'); },
 28             showImpersonateRole: function() { _display('LABKEY.Security.ImpersonateRoles'); }
 29         };
 30     };
 31 
 32     return impl;
 33 
 34 }(LABKEY.Security || new function() { return {}; });