You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@roller.apache.org by Dave <sn...@gmail.com> on 2008/06/04 19:53:19 UTC
Re: AuthoritiesPopulator
On Sat, May 31, 2008 at 9:21 AM, Gene McCulley <mc...@stackframe.com> wrote:
> I am deploying Roller (currently using development trunk) to an intranet.
> The intranet uses Apache2 connected to Tomcat 5.5 via mod_jk. The site is
> served up over https and protected by basic auth using OpenLDAP for
> authentication. I have configured the Acegi security.xml to use the
> OpenLDAP server as described in the documentation.
>
> I had trouble with AuthoritiesPopulator throwing a ClassCastException and
> had to make the following patch with which initial user authentication now
> works fine. It looks like the code assumed that UserManager.getRoles()
> returned List<UserRole> but it returns List<String>.
>
> Index:
> apps/weblogger/src/java/org/apache/roller/weblogger/ui/core/security/AuthoritiesPopulator.java
> ===================================================================
> ---
> apps/weblogger/src/java/org/apache/roller/weblogger/ui/core/security/AuthoritiesPopulator.java
> (revision 661721)
> +++
> apps/weblogger/src/java/org/apache/roller/weblogger/ui/core/security/AuthoritiesPopulator.java
> (working copy)
> @@ -30,7 +30,6 @@
> import org.apache.roller.weblogger.business.Weblogger;
> import org.apache.roller.weblogger.business.WebloggerFactory;
> import org.apache.roller.weblogger.pojos.User;
> -import org.apache.roller.weblogger.pojos.UserRole;
> import org.springframework.util.Assert;
>
>
> @@ -70,8 +69,8 @@
> GrantedAuthority[] authorities = new
> GrantedAuthorityImpl[roleCount];
> int i = 0;
> for (Iterator it = roles.iterator(); it.hasNext();) {
> - UserRole role = (UserRole) it.next();
> - authorities[i++] = new GrantedAuthorityImpl(role.getRole());
> + String role = (String) it.next();
> + authorities[i++] = new GrantedAuthorityImpl(role);
> }
>
> if (defaultRole != null) {
Looks like a real live bug. I filed an issue for you here:
https://issues.apache.org/roller/browse/ROL-1724
Thanks,
- Dave