[jboss-jira] [JBoss JIRA] Commented: (JBPORTAL-2352) I cannot create a role in LDAP
Luca Stancapiano (JIRA)
jira-events at lists.jboss.org
Thu Mar 26 06:38:22 EDT 2009
[ https://jira.jboss.org/jira/browse/JBPORTAL-2352?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12459174#action_12459174 ]
Luca Stancapiano commented on JBPORTAL-2352:
--------------------------------------------
the same thing could to be added also in :
org.jboss.portal.identity.ldap.LDAPExtRoleModuleImpl findRoleByName(String name) method
75 row:
if (sr.size() == 0)
{
throw new IdentityException("No such role " + name);
}
org.jboss.portal.identity.ldap.LDAPExtUserModuleImpl findRoleByName(String name) method
76 row:
if (sr.size() == 0)
{
throw new IdentityException("No such user " + userName);
}
org.jboss.portal.identity.ldap.LDAPUserModuleImpl findUserByUserName(String userName) method
88 row:
if (sr.size() == 0)
{
throw new IdentityException("No such user " + userName);
}
so all UserModule and RoleModule implementations work in the same manner launching a IdentityException when they have no results
> 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)
> Components: Portal Identity
> Affects Versions: 2.7.2 Final
> Environment: JBoss Portal 2.7.2, JBoss 4.2.3.GA, openldap
> Reporter: Luca Stancapiano
> Assignee: Luca Stancapiano
> Fix For: 2.8 Final, Identity-1.1
>
>
> 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