When got a 403 response in glance panel, it will be redirect to log out

Bug #1818659 reported by mashuting
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
horizon (Ubuntu)
New
Undecided
mashuting

Bug Description

Based on implemented by angularjs framework, glance panel has such a problem:
1. Set get_metadef_namespaces to '!' in glance/policy.json
2. Log into horizon and direct to image panel
3. Horizon will accept a response like:
   403 Forbidden: You are not authorized to complete get_metadef_namespaces action. (HTTP 403)"
   Due to the following code, web will be redirect to login page:
  function httpRedirectLogin($q, $rootScope, $window, frameworkEvents, toastService) {
    return {
      responseError: function (error) {
        if (error.status === 401) {
          var msg = gettext('Unauthorized. Redirecting to login');
          handleRedirectMessage(msg, $rootScope, $window, frameworkEvents, toastService);
        }
        if (error.status === 403) {
          var msg2 = gettext('Forbidden. Redirecting to login');
          handleRedirectMessage(msg2, $rootScope, $window, frameworkEvents, toastService);
        }
        return $q.reject(error);
      }
    };
  }

I don't think it make sense to log out because the policy restricts this operation, but have no idea how to optimize. Hope anyone can give me suggestions.

mashuting (mashuting)
Changed in horizon (Ubuntu):
assignee: nobody → mashuting (mashuting)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.