Properly support resolveReference in UserLogic

Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/d862c40c
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/d862c40c
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/d862c40c

Branch: refs/heads/2_0_X
Commit: d862c40c1ed7899e4f35e8f3913f46bb51cd1866
Parents: cc046f1
Author: Francesco Chicchiriccò <[email protected]>
Authored: Mon Dec 4 10:50:57 2017 +0100
Committer: Francesco Chicchiriccò <[email protected]>
Committed: Mon Dec 4 10:50:57 2017 +0100

----------------------------------------------------------------------
 .../src/main/java/org/apache/syncope/core/logic/UserLogic.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/d862c40c/core/logic/src/main/java/org/apache/syncope/core/logic/UserLogic.java
----------------------------------------------------------------------
diff --git 
a/core/logic/src/main/java/org/apache/syncope/core/logic/UserLogic.java 
b/core/logic/src/main/java/org/apache/syncope/core/logic/UserLogic.java
index dfedc10..b79234c 100644
--- a/core/logic/src/main/java/org/apache/syncope/core/logic/UserLogic.java
+++ b/core/logic/src/main/java/org/apache/syncope/core/logic/UserLogic.java
@@ -511,13 +511,17 @@ public class UserLogic extends AbstractAnyLogic<UserTO, 
UserPatch> {
                     key = ((UserTO) args[i]).getKey();
                 } else if (args[i] instanceof UserPatch) {
                     key = ((UserPatch) args[i]).getKey();
+                } else if (args[i] instanceof StatusPatch) {
+                    key = ((StatusPatch) args[i]).getKey();
                 }
             }
+        } else if ("requestPasswordReset".equals(method.getName())) {
+            key = userDAO.findKey((String) args[0]);
         }
 
         if (key != null) {
             try {
-                return binder.getUserTO((String) key);
+                return binder.getUserTO(key);
             } catch (Throwable ignore) {
                 LOG.debug("Unresolved reference", ignore);
                 throw new UnresolvedReferenceException(ignore);

Reply via email to