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

Version Path
katello-2.4.5 engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/check-current-organization.run.js
katello-2.4.4 engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/check-current-organization.run.js
katello-2.4.3 engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/check-current-organization.run.js
katello-2.4.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/check-current-organization.run.js
katello-3.0.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/check-current-organization.run.js
katello-2.4.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/check-current-organization.run.js
katello-2.4.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/check-current-organization.run.js
katello-2.4.0.rc3 engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/check-current-organization.run.js
katello-2.4.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/check-current-organization.run.js
katello-2.4.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/check-current-organization.run.js