You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by "David Johnson (JIRA)" <ji...@apache.org> on 2008/06/04 19:52:58 UTC

[jira] Created: (ROL-1724) Bug in trunk AuthoritiesPopulator.java

Bug in trunk AuthoritiesPopulator.java
--------------------------------------

                 Key: ROL-1724
                 URL: https://issues.apache.org/roller/browse/ROL-1724
             Project: Roller
          Issue Type: Bug
          Components: Authentication, Roles and Access Controls
    Affects Versions: 4.1
            Reporter: David Johnson
            Assignee: Roller Unassigned
            Priority: Minor
             Fix For: 4.1



On Sat, May 31, 2008 at 9:21 AM, Gene McCulley 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) {

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.