[seam-commits] Seam SVN: r8492 - trunk/src/main/org/jboss/seam/security/management.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Wed Jul 23 01:39:45 EDT 2008


Author: shane.bryzak at jboss.com
Date: 2008-07-23 01:39:44 -0400 (Wed, 23 Jul 2008)
New Revision: 8492

Modified:
   trunk/src/main/org/jboss/seam/security/management/JpaIdentityStore.java
Log:
only user-class is required

Modified: trunk/src/main/org/jboss/seam/security/management/JpaIdentityStore.java
===================================================================
--- trunk/src/main/org/jboss/seam/security/management/JpaIdentityStore.java	2008-07-23 05:39:00 UTC (rev 8491)
+++ trunk/src/main/org/jboss/seam/security/management/JpaIdentityStore.java	2008-07-23 05:39:44 UTC (rev 8492)
@@ -90,19 +90,7 @@
    
    @Create
    public void init()
-   {            
-      if (userClass == null)
-      {
-         log.debug("No userClass set, JpaIdentityStore will be unavailable.");
-         return;
-      }
-      
-      if (roleClass == null)
-      {
-         log.debug("No roleClass set, JpaIdentityStore will be unavailable.");
-         return;
-      }
-      
+   {                  
       if (featureSet == null)
       {
          featureSet = new FeatureSet();
@@ -114,6 +102,12 @@
          entityManager = Expressions.instance().createValueExpression("#{entityManager}", EntityManager.class);
       }      
       
+      if (userClass == null)
+      {
+         log.debug("Error in JpaIdentityStore configuration - userClass must be configured.");
+         return;
+      }    
+      
       initProperties();   
    }
    
@@ -125,30 +119,27 @@
       userEnabledProperty = AnnotatedBeanProperty.scanForProperty(userClass, UserEnabled.class);
       userFirstNameProperty = AnnotatedBeanProperty.scanForProperty(userClass, UserFirstName.class);
       userLastNameProperty = AnnotatedBeanProperty.scanForProperty(userClass, UserLastName.class);
+       
+      if (roleClass != null)
+      {
+         roleNameProperty = AnnotatedBeanProperty.scanForProperty(roleClass, RoleName.class);
+         roleGroupsProperty = AnnotatedBeanProperty.scanForProperty(roleClass, RoleGroups.class);
+         roleConditionalProperty = AnnotatedBeanProperty.scanForProperty(roleClass, RoleConditional.class);
+      }
       
-      roleNameProperty = AnnotatedBeanProperty.scanForProperty(roleClass, RoleName.class);
-      roleGroupsProperty = AnnotatedBeanProperty.scanForProperty(roleClass, RoleGroups.class);
-      roleConditionalProperty = AnnotatedBeanProperty.scanForProperty(roleClass, RoleConditional.class);
-      
       if (userPrincipalProperty == null) 
       {
          throw new IdentityManagementException("Invalid userClass " + userClass.getName() + 
                " - required annotation @UserPrincipal not found on any Field or Method.");
       }
       
-      if (userPasswordProperty == null) 
-      {
-         throw new IdentityManagementException("Invalid userClass " + userClass.getName() + 
-               " - required annotation @UserPassword not found on any Field or Method.");
-      }      
-      
       if (userRolesProperty == null)
       {
          throw new IdentityManagementException("Invalid userClass " + userClass.getName() + 
          " - required annotation @UserRoles not found on any Field or Method.");         
       }
       
-      if (roleNameProperty == null)
+      if (roleClass != null && roleNameProperty == null)
       {
          throw new IdentityManagementException("Invalid roleClass " + roleClass.getName() + 
          " - required annotation @RoleName not found on any Field or Method.");         




More information about the seam-commits mailing list