Sha256: dfdc8ed2cb26ea9c5b415c9fd59d64a8061ca4212ad5f143b76a1c1842898478
Contents?: true
Size: 1.22 KB
Versions: 10
Compression:
Stored size: 1.22 KB
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) { var fencedPages = [ 'products', 'activation-keys', 'environments', 'subscriptions', 'gpg-keys', 'sync-plans', 'content-views', 'errata', 'content-hosts', 'host-collections' ]; $rootScope.$on('$stateChangeStart', function (event, toState) { if (CurrentOrganization === "" && fencedPages.indexOf(toState.name.split('.')[0]) !== -1) { event.preventDefault(); $rootScope.transitionTo('organizations.select', {toState: toState.url}); } }); } angular .module('Bastion.organizations') .run(CheckCurrentOrganization); CheckCurrentOrganization.$inject = ['$rootScope', '$window', 'CurrentOrganization']; })();
Version data entries
10 entries across 10 versions & 1 rubygems