Uploaded image for project: 'JBoss Portal'
  1. JBoss Portal
  2. JBPORTAL-2352

I cannot create a role in LDAP

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 2.7.2 Final
    • Fix Version/s: 2.8 Final, Identity-1.1
    • Component/s: Portal Identity
    • Labels:
      None
    • Environment:

      JBoss Portal 2.7.2, JBoss 4.2.3.GA, openldap

      Description

      If I try to create a role in JBoss Portal configured with LDAP through admin web console, I get a validation error by org.jboss.portal.core.identity.ui.validators.RoleValidator class. The problem is that RoleValidator searches for a role with the inserted role name using findRoleByName(String name) method of org.jboss.portal.identity.ldap.LDAPRoleModuleImpl. This method starts an Exception by 80 row:

      SearchResult res = (SearchResult)sr.iterator().next();

      because there are no roles for that name.

      The better thing to do could to be managing of a IdentityException when the search produces no results. Here there is an example:

      List sr = searchRoles(filter, null);
      if (sr.size() > 1)

      { throw new IdentityException("Found more than one role with id: " + name + "" + "Posible data inconsistency"); }

      ---- new --------
      if (sr.size() == 0)

      { throw new IdentityException("No such role " + name); }

      -------------------

      starting a IdentityException, RoleValidator instance will ignore the problem and let to use createRole method to create the new role

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                sviluppatorefico Luca Stancapiano
                Reporter:
                sviluppatorefico Luca Stancapiano
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: