[seam-commits] Seam SVN: r8996 - trunk/src/main/org/jboss/seam/web.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Mon Sep 15 22:10:16 EDT 2008


Author: shane.bryzak at jboss.com
Date: 2008-09-15 22:10:16 -0400 (Mon, 15 Sep 2008)
New Revision: 8996

Modified:
   trunk/src/main/org/jboss/seam/web/IdentityRequestWrapper.java
Log:
JBSEAM-3374

Modified: trunk/src/main/org/jboss/seam/web/IdentityRequestWrapper.java
===================================================================
--- trunk/src/main/org/jboss/seam/web/IdentityRequestWrapper.java	2008-09-15 19:28:53 UTC (rev 8995)
+++ trunk/src/main/org/jboss/seam/web/IdentityRequestWrapper.java	2008-09-16 02:10:16 UTC (rev 8996)
@@ -28,12 +28,13 @@
    }
 
    @Override
-   public Principal getUserPrincipal() {
-      return Identity.isSecurityEnabled() ? identity.getPrincipal() : null;
+   public Principal getUserPrincipal() 
+   {
+      return Identity.isSecurityEnabled() && identity != null ? identity.getPrincipal() : null;
    }
 
    @Override
    public boolean isUserInRole(String role) {
-      return getUserPrincipal() != null ? identity.hasRole(role) : false;
+      return getUserPrincipal() != null && identity != null ? identity.hasRole(role) : false;
    }
 }




More information about the seam-commits mailing list