Sha256: 353ff17b0766b0a13adf97cf62dc22a27e97e2b492579af7c8e98e9ca3f70623

Contents?: true

Size: 937 Bytes

Versions: 8

Compression:

Stored size: 937 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) {
            if (CurrentOrganization === "" && FencedPages.isFenced(toState)) {
                event.preventDefault();
                $rootScope.transitionTo('organizations.select', {toState: toState.url});
            }
        });

    }

    angular
        .module('Bastion.organizations')
        .run(CheckCurrentOrganization);

    CheckCurrentOrganization.$inject = ['$rootScope', '$window', 'CurrentOrganization', 'FencedPages'];

})();

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
katello-3.0.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/check-current-organization.run.js
katello-3.0.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/check-current-organization.run.js
katello-3.0.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/check-current-organization.run.js
katello-3.0.0.rc7 engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/check-current-organization.run.js
katello-3.0.0.rc5 engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/check-current-organization.run.js
katello-3.0.0.rc4 engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/check-current-organization.run.js
katello-3.0.0.rc3 engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/check-current-organization.run.js
katello-3.0.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/organizations/check-current-organization.run.js