Skip to content

Implementation Role Feature 6

Max Leuthäuser edited this page Nov 18, 2021 · 6 revisions

Title

The sequence of role acquisition and removal may be restricted

Description

E.g. you are only allowed to be a voter if you are not a prisoner (in some countries).

Implementation

There is no direct support in SCROLL for this. Of course you can implement your own business-related rules as plain Scala code between role acquiring and removal.

Additional hints

SCROLL supports defining your own sequences of role acquisition and removal through the usage of finite state machines. Have a look at the RolePlayingAutomaton and the corresponding RolePlayingAutomatonTest.

Clone this wiki locally