Sha256: 838a4554023ca128daa7f00c521fa3eb9e98fb1f69c07a6de28670dfe3b7ca1a
Contents?: true
Size: 1002 Bytes
Versions: 235
Compression:
Stored size: 1002 Bytes
Contents
(function () { /** * @ngdoc run * @name Bastion.run:CheckCurrentOrganization * * @description * Checks whether a page requires a current organization to be set and if it does * redirects the user to the Katello 403 page to instruct them to select an organization to proceed. */ function CheckCurrentOrganization($rootScope, $window, CurrentOrganization, FencedPages) { $rootScope.$on('$stateChangeStart', function (event, toState, toParams) { if (CurrentOrganization === "" && FencedPages.isFenced(toState)) { event.preventDefault(); $rootScope.transitionTo('organizations.select', {toState: $rootScope.$state.href(toState.name, toParams, {absolute: 'true'})}); } }); } angular .module('Bastion.organizations') .run(CheckCurrentOrganization); CheckCurrentOrganization.$inject = ['$rootScope', '$window', 'CurrentOrganization', 'FencedPages']; })();
Version data entries
235 entries across 235 versions & 1 rubygems