1 Reply Latest reply on Mar 16, 2004 11:08 AM by 807574

    Access Portal user role from JSP ?

      I am writing a JSP which needs to display the user role of the user logged into the portal server.

      For this i am making use of the profile object which i retrive from the session.

      SessionID sid = new SessionID(request);
      Session sess = Session.getSession(sid);
      Profile prof = sess.getUserProfile();
      String x = prof.getAttributeString("iwtUserInfoProvider-firstName");
      out.println("Portal Server User First Name: " + x + "<BR>");

      String y = prof.getAttributeString("iwtUser-role");

      out.println("Portal Server User Role : " + y + "<BR>");

      However i am hitting a problem here. I am able to retrive the user role only on occasions when the admin users are logging in. In the case when the normal user is loggin in the JSP is throwing the following error while trying to access the user role.

      "An error occured! com.iplanet.portalserver.profile.ProfileException: Permission denied in getting attributes or privileges."

      What do i have to do to retrive the user role from the profile server ? Is the profile accessible to only admin users ?

      Any suggestion or help is welcome.

      Thanks in advance