feature request #6655
Updated by Andreas Kohlbecker over 6 years ago
We need a `RegistrationManager` `RegistrationStateManager` which can change the RegistrationState on behalf of the user, since the user is not permitted to change the Registration again (see #6654, see **first step** and **second step** --> this issue only is needed for the second step!!!). The user can request the `RegistrationManager` `RegistrationStateManager` for state changes by sending a `RegistrationStateEvent`. The `RegistrationStateEvent` can transport the following messages to which the `RegistrationManager` `RegistrationStateManager` will react accordingly to the current state, the users permission sending the event: The `RegistrationManager` `RegistrationStateManager` uses the following internal permission tests: * isRegistrationCurator: `user.hasGrantedAuthority("Registration.[UPDATE]")` * isAllowedSumbitter: `user = Registration.submitter AND user.hasGrantedAuthority("Registration.[CREATE]")` | RegistrationStateEvent | RegistrationManager RegistrationStateManager | | | |------------------------|---------------------------------------------|-------------------------------|---------------| | **Event message** | **tests** | **state to check** | **new state** | | `WITHDRAW` | isAllowedSumbitter OR isRegistrationCurator | not `PUBLISHED` | `REJECTED` | | `DATA_VALID` | isRegistrationCurator | not `PUBLISHED` OR `REJETCED` | `READY` | | `DATA_INCOMPLETE` | isRegistrationCurator | not `PUBLISHED` OR `REJETCED` | `PREPARATION` | | `PUBLISHED` | isRegistrationCurator && publication.datePublished != null | `READY` | `PUBLISHED` | * Walter suggested **automatic setting of `PUBLISHED`**: When the registration state is `READY` the RegistrationManager RegistrationStateManager could listen for changes of the `datePublished` of the related citation. Once the `datePublished` is set to a non null value the RegistrationState will automatically be set to `PUBLISHED`.