The 'UserAgreements' module aims to goven the amount of active users in the system.
Out of the box the 'UserAgreements' module will deactivate any users outside of the limit on an daily basis (via a scheduled event). The users deactivated will be those who have the oldest last login dates.
However, if this module is being used where a different action must performed on the users, developers can create another UA_ microflow with custom logic.
Typical usage scenario
An IT Company charges client companies that use their system a per user fee. This fee is charged on a monthly basis. A client wants to increase the number of users they can have, or decrease the number of users. The IT Company wants these number of limits to be enforced.
The User Agreements module will ensure that number of active users is not exceeded.
Features and limitations
- Create, Edit, Delete and Cancel User Agreements
- Configure the updater process by providing:
- Custom logic for the updater with a custom ‘UA_’ microflow
- The administrator role that will remain active for the users.
- When a user is set inactive, the administrator’s will need to reactivate the users manually if those users need to be reactivated.
- 7.23.19 (Module can be updated to later versions of Mendix, but caution should be exercised)
- Administration, including an entity named 'Account' which has associations with 'UserRoles'. (Standard Adminstration Module)
- System Module (default)
- Import the module 'UserAgreements' into your project and any dependancies the project lacks.
- Link page 'ActiveUserAgreements_Overview' found in the _USE_ME folder to an applicable navigation button.
- Add the 'AS_CreateSchedulerUser' to your on start up microflow.
- Set the two constants found in the USE_ME > Constants folder. Take note of their description.
- Create a system user role called 'SchedulerUser' and attach the UserAgreements role 'SchedulerUser' in the project security.
- Start the application.
- Run MxReflection (ensure that UserAgreements and/or the module where your custom logic is, are selected).
- Navigate to configurations page (found on the overview page) and setup the following:
- Active: select whether or not the UserAgreements process is active or not.
- Updater Microflow: select your custom 'UA_' microflow or if no custom logic must be used,set this field to 'UA_Updater_Default'. This microflow will apply the default user agreement logic. The default logic activates the user agreement and deactivates all the users exceeding the agreed number of active users allowed. NOTE: The accounts effected should be sorted by LastLogin ASC before changing these objects (For the standard system).Admin User Role: set the user role which is used as the administrator in the system. These roles will not be deactivated in the updating process.
- Execute Agreement Updater Now: executes the process of updating the User Agreements. This will also reduce the number of active users to the number of users that is agreed upon. If no agreement is in place only the 'Administrator User Role' will remain active.
- Navigate to the Overview page and add a new agreement using the 'New'. Or edit an existing one using the 'Edit' button. After the agreement has been created the agreement will stay in the pending state until the system applies it on the effective date.
- Effective Date: the date from which the user agreement will be applied.
- Number of active users: the number of active users that will be applied and restricted to on the system.
- Manage Active User Agreements
- Edit: Allows the user to edit the user agreement if it is still pending.
- Cancel: Deactivates a 'Pending' or 'Active' user agreement.
- View Effect Log: View the number all the effects that the agreement has had on the user base.
- Delete User Agreement: Only administrators can perform this action.
Frequently Asked Questions
Question: What will happen if no agreement is set, X users active are active, and the updater runs?
Answer: X users will be set inactive, excluding the accounts that are ‘Administrator Roles’. If you haven’t set the administrator role then all active users will be deactivated.
Question: What if there is no custom ‘UA_’ microflow set?
Answer: The updater will not run and an error will be thrown in the logs.
Question: Can I set a user agreement in the past?
Answer: Yes, but you can only set it as far back as the previous User Agreement.