Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
reg-app
Regapp
Commits
d7bc4558
Commit
d7bc4558
authored
Jun 01, 2015
by
michael.simon
Browse files
example rules update
parent
f3c6afb7
Changes
1
Hide whitespace changes
Inline
Side-by-side
rules/uc1-access.drl
View file @
d7bc4558
...
...
@@ -3,9 +3,37 @@ package edu.kit.scc.webreg.dools.unicluster
import
edu
.
kit
.
scc
.
webreg
.
entity
.
UserEntity
;
import
edu
.
kit
.
scc
.
webreg
.
entity
.
SamlIdpMetadataEntity
;
import
edu
.
kit
.
scc
.
webreg
.
drools
.
UnauthorizedUser
;
import
edu
.
kit
.
scc
.
webreg
.
entity
.
RegistryEntity
;
import
edu
.
kit
.
scc
.
webreg
.
entity
.
as
.
ASUserAttrEntity
;
import
edu
.
kit
.
scc
.
webreg
.
entity
.
as
.
ASUserAttrValueStringEntity
;
import
java
.
util
.
Date
;
global
org
.
slf4j
.
Logger
logger
;
rule
"AA Attribute test"
when
$
user
:
UserEntity
(
$
userAttrs
:
userAttrs
)
$
userAttr
:
ASUserAttrEntity
(
attributeSource
.
name
==
"UC1-StatsAccess"
,
$
values
:
values
)
from
$
userAttrs
ASUserAttrValueStringEntity
(
key
==
"result"
&&
valueString
==
"1"
)
from
$
values
then
logger
.
info
(
"Insert positive result String for user {}"
,
$
user
.
getEppn
()
);
insert
(
new
String
(
"umfrage-is-set"
)
);
end
rule
"AA String test"
when
not
(
String
(
this
==
"umfrage-is-set"
)
)
$
date
:
Date
()
$
registry
:
RegistryEntity
(
($
date
.
getTime
()
-
agreedTime
.
getTime
())
>
14
*
24
*
60
*
60
*
1000
)
then
logger
.
info
(
"Umfrage is not set or too old"
);
insert
(
new
UnauthorizedUser
(
null
,
"no-umfrage"
)
);
end
rule
"is bwIdm Member"
when
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment