Last active
October 6, 2020 18:48
-
-
Save lchanmann/eb103b217c5d9e49d82893bc0b13ce77 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/foam/nanos/ruler/Rule.js b/src/foam/nanos/ruler/Rule.js | |
index cb01c8599..acb7bbe93 100644 | |
--- a/src/foam/nanos/ruler/Rule.js | |
+++ b/src/foam/nanos/ruler/Rule.js | |
@@ -480,7 +480,16 @@ | |
Subclasses of Rule should override "getUser" method to return the | |
appropriate user for which the permission is checked. | |
`, | |
- javaCode: 'return null;' | |
+ javaCode: ` | |
+ var userExpr = getUserExpr(); | |
+ if ( userExpr != null ) { | |
+ var result = userExpr.f(obj); | |
+ if ( result instanceof User ) { | |
+ return result; | |
+ } | |
+ } | |
+ return null; | |
+ ` | |
} | |
], | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/nanopay/src/net/nanopay/crunch/compliance/rules.jrl b/nanopay/src/net/nanopay/crunch/compliance/rules.jrl | |
index 873a0cbe33..327c789c04 100644 | |
--- a/nanopay/src/net/nanopay/crunch/compliance/rules.jrl | |
+++ b/nanopay/src/net/nanopay/crunch/compliance/rules.jrl | |
@@ -23,6 +23,14 @@ p({ | |
} | |
] | |
}, | |
+ "userExpr": { | |
+ "class":"foam.mlang.expr.Ref", | |
+ "arg1":{ | |
+ class: "__Property__", | |
+ forClass_: "foam.nanos.crunch.UserCapabilityJunction", | |
+ name: "sourceId" | |
+ } | |
+ }, | |
"asyncAction":{ | |
"class":"net.nanopay.crunch.compliance.SecurefactSIDniValidator", | |
"classification":"Validate Signing Officer UserCapabilityJunction Using SecureFact" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment