Author: shane.bryzak(a)jboss.com
Date: 2010-07-15 23:36:40 -0400 (Thu, 15 Jul 2010)
New Revision: 13410
Modified:
modules/security/trunk/examples/idmconsole/src/main/resources/import.sql
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/IdentityManagerImpl.java
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java
Log:
fix relationship directions
Modified: modules/security/trunk/examples/idmconsole/src/main/resources/import.sql
===================================================================
--- modules/security/trunk/examples/idmconsole/src/main/resources/import.sql 2010-07-15
14:46:21 UTC (rev 13409)
+++ modules/security/trunk/examples/idmconsole/src/main/resources/import.sql 2010-07-16
03:36:40 UTC (rev 13410)
@@ -16,4 +16,4 @@
insert into IdentityObjectRelationshipType (id, name) values (1,
'JBOSS_IDENTITY_MEMBERSHIP');
insert into IdentityObjectRelationshipType (id, name) values (2,
'JBOSS_IDENTITY_ROLE');
-insert into IdentityObjectRelationship (id, name, relationship_type_id, from_identity_id,
to_identity_id) values (1, 'admin', 2, 1, 3);
+insert into IdentityObjectRelationship (id, name, relationship_type_id, from_identity_id,
to_identity_id) values (1, 'admin', 2, 3, 1);
Modified:
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/IdentityManagerImpl.java
===================================================================
---
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/IdentityManagerImpl.java 2010-07-15
14:46:21 UTC (rev 13409)
+++
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/IdentityManagerImpl.java 2010-07-16
03:36:40 UTC (rev 13410)
@@ -35,7 +35,7 @@
*
* @author Shane Bryzak
*/
-@RequestScoped @Transactional
+@RequestScoped
public class IdentityManagerImpl implements IdentityManager, Serializable
{
private static final long serialVersionUID = 6864253169970552893L;
@@ -55,7 +55,7 @@
@Inject IdentitySession identitySession;
- public boolean createUser(String name, Credential credential)
+ public @Transactional boolean createUser(String name, Credential credential)
{
identity.checkPermission(RESOURCE_IDENTITY, PERMISSION_CREATE);
try
Modified:
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java
===================================================================
---
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java 2010-07-15
14:46:21 UTC (rev 13409)
+++
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/JpaIdentityStore.java 2010-07-16
03:36:40 UTC (rev 13410)
@@ -1364,11 +1364,11 @@
CriteriaQuery<?> criteria = builder.createQuery(relationshipClass);
Root<?> root = criteria.from(relationshipClass);
- Property<?> identityFromProperty =
modelProperties.get(PROPERTY_RELATIONSHIP_FROM);
+ Property<?> identityToProperty =
modelProperties.get(PROPERTY_RELATIONSHIP_TO);
Property<?> relationshipNameProperty =
modelProperties.get(PROPERTY_RELATIONSHIP_NAME);
List<Predicate> predicates = new ArrayList<Predicate>();
- predicates.add(builder.equal(root.get(identityFromProperty.getName()),
+ predicates.add(builder.equal(root.get(identityToProperty.getName()),
lookupIdentity(identity, em)));
criteria.where(predicates.toArray(new Predicate[0]));
@@ -1567,12 +1567,12 @@
if (parent)
{
- predicates.add(builder.equal(root.get(relationshipToProp.getName()),
+ predicates.add(builder.equal(root.get(relationshipFromProp.getName()),
lookupIdentity(identity, em)));
}
else
{
- predicates.add(builder.equal(root.get(relationshipFromProp.getName()),
+ predicates.add(builder.equal(root.get(relationshipToProp.getName()),
lookupIdentity(identity, em)));
}
Show replies by date