Uploaded image for project: 'Jira Service Management Data Center'
  1. Jira Service Management Data Center
  2. JSDSERVER-3950

P2 Component API not working for portal users (eg portal lookup by project)

XMLWordPrintable

      I'm running into problems with most attempts to use the p2 component JSD API.

      For example:

      Lookup Service Desks for a given user

      If a Portal User is registered and in the Service Desk Customers role, I would expect the following to return an actual value:

      PortalService ps ComponentAccessor.getOSGiComponentInstanceOfType(PortalService.class);
      Portal portal = ps.getPortalForProject(portalUser, projectObj).getOrNull();
      

      It returns a null with a left() error of:

      Either.Left(AnError{httpStatusCode=403, errorCode=none(), message='sd.portal.error.permission : 'You do not have permission to view this Portal.''})
      

      On the outside chance, I tried asserting that portalUser via JiraAuthenticationContext with identical results.

      Using the alternate non-deprecated method search by ID:

      PortalService ps ComponentAccessor.getOSGiComponentInstanceOfType(PortalService.class);
      Portal portal = ps.getPortalForId(portalUser, projectObj.getId()).getOrNull();
      

      Same results...

      I even tried this where the current (logged in user) and the 'target' user was the same user, an Agent in the target project, and still get null.

      I can't see what could be done differently, if I'm missing something please point it out

      At the very least, the error messages about lacking permissions really need more detail adding given the 'complex' nature of how that decision could be reached.

            Unassigned Unassigned
            cd3cc7134331 Andy Brook
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: