[jboss-jira] [JBoss JIRA] Created: (JBPORTAL-2352) I cannot create a role in LDAP

Luca Stancapiano (JIRA) jira-events at lists.jboss.org
Mon Mar 23 10:37:30 EDT 2009


I cannot create a role in LDAP
------------------------------

                 Key: JBPORTAL-2352
                 URL: https://jira.jboss.org/jira/browse/JBPORTAL-2352
             Project: JBoss Portal
          Issue Type: Bug
      Security Level: Public (Everyone can see)
    Affects Versions: 2.7.2 Final
         Environment: JBoss Portal 2.7.2, JBoss 4.2.3.GA, openldap 
            Reporter: Luca Stancapiano
             Fix For: 2.8 Final


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

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list