Author: shane.bryzak(a)jboss.com
Date: 2009-12-07 05:57:54 -0500 (Mon, 07 Dec 2009)
New Revision: 11766
Modified:
branches/community/Seam_2_2/src/main/org/jboss/seam/security/permission/PersistentPermissionResolver.java
branches/community/Seam_2_2/src/remoting/org/jboss/seam/remoting/messaging/UserTokens.java
Log:
fix NPE
Modified:
branches/community/Seam_2_2/src/main/org/jboss/seam/security/permission/PersistentPermissionResolver.java
===================================================================
---
branches/community/Seam_2_2/src/main/org/jboss/seam/security/permission/PersistentPermissionResolver.java 2009-12-06
23:49:03 UTC (rev 11765)
+++
branches/community/Seam_2_2/src/main/org/jboss/seam/security/permission/PersistentPermissionResolver.java 2009-12-07
10:57:54 UTC (rev 11766)
@@ -79,11 +79,11 @@
List<Permission> permissions = permissionStore.listPermissions(target,
action);
- String username = identity.getPrincipal().getName();
+ String username = identity.getPrincipal() != null ?
identity.getPrincipal().getName() : null;
for (Permission permission : permissions)
{
- if (permission.getRecipient() instanceof SimplePrincipal &&
+ if (username != null && permission.getRecipient() instanceof
SimplePrincipal &&
username.equals(permission.getRecipient().getName()))
{
return true;
Modified:
branches/community/Seam_2_2/src/remoting/org/jboss/seam/remoting/messaging/UserTokens.java
===================================================================
---
branches/community/Seam_2_2/src/remoting/org/jboss/seam/remoting/messaging/UserTokens.java 2009-12-06
23:49:03 UTC (rev 11765)
+++
branches/community/Seam_2_2/src/remoting/org/jboss/seam/remoting/messaging/UserTokens.java 2009-12-07
10:57:54 UTC (rev 11766)
@@ -1,5 +1,6 @@
package org.jboss.seam.remoting.messaging;
+import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;
@@ -10,7 +11,7 @@
@Name("org.jboss.seam.remoting.messaging.SubscriptionRegistry.userTokens")
@Scope(ScopeType.SESSION)
-public class UserTokens
+public class UserTokens implements Serializable
{
Set<String> tokens = new HashSet<String>();