| ... | ... | @@ -16,4 +16,27 @@ Autoapproves a registry based on a rule. The events that can be used are: APPROV |
|
|
|
|
|
|
|
Values in **bold** are required.
|
|
|
|
|
|
|
|
### Example rule
|
|
|
|
|
|
|
|
This rule insterts an UnauthorizedUser object in the drools environment. If such an object is found, the user will stay in the approval process. If there is no such object, which means user is from dr-evil IDP, the registry will be approved automatically.
|
|
|
|
|
|
|
|
```
|
|
|
|
package edu.kit.scc.webreg.drools.autoappr
|
|
|
|
|
|
|
|
import edu.kit.scc.webreg.entity.SamlUserEntity;
|
|
|
|
import edu.kit.scc.webreg.drools.UnauthorizedUser;
|
|
|
|
|
|
|
|
global org.slf4j.Logger logger;
|
|
|
|
|
|
|
|
rule "specific IDP is set"
|
|
|
|
|
|
|
|
when
|
|
|
|
$user : SamlUserEntity( idp.entityId != "https://idp.dr-evil.org/idp/shibboleth" )
|
|
|
|
then
|
|
|
|
logger.info( "User {} is not from dr-evil corp. Stays in approval process. ", $user.getId() );
|
|
|
|
insert( new UnauthorizedUser($user, "idp-wrong") );
|
|
|
|
|
|
|
|
end
|
|
|
|
```
|
|
|
|
|
|
|
|
[Back to job classes overview](./classes) |
|
|
\ No newline at end of file |