wiki : Technical documentation > Manage users by organizational unit - the Unittree plugin and the forms-unittree and workflow-unittr
Manage users by organizational unit - the Unittree plugin and the forms-unittree and workflow-unittree modules
- Plugin Presentation
- Plugin Features
- Configuration of Organizational Entities
- Creating a New Organizational Entity
- Modifying an Organizational Entity
- Deleting an Organizational Entity
- Moving an Organizational Entity in the Organizational Entity Hierarchy
- Viewing User Accounts Assigned to an Organizational Entity
- Searching for User Accounts in the Organizational Entity Hierarchy
- Assigning Users to Organizational Entities
- Moving a User Account in the Organizational Entity Hierarchy
- Unassigning a User Account from an Organizational Entity
- Displaying Form Responses Based on Organizational Entity Configuration
- Configuring Form Response Assignment to an Organizational Entity via Workflow Tasks
- Other Resources (Useful Links, GitHub, etc)
Plugin Presentation
The Unittree plugin allows for fine organization of back-office user accounts by organizational entity. Organizational entities are hierarchical groups and subgroups. Responses to Lutece forms can be assigned to an organizational entity via a task from the Workflow plugin. Form responses are thus distributed according to the organization set up to handle the responses. The workflow-unittree module and forms-unittree module must also be installed.
The plugin addresses the need for secure data access and distribution of form response management. The organizational entity hierarchy limits user views to certain responses from certain forms in a Lutece application.
Usage example:
- An organizational entity can be the primary recipient of responses, another may specialize in certain types of files and be the sole recipient, etc.
- Users can be assigned to an organizational entity representing a business unit, and only the form responses identified as related to this unit will be accessible to this group.
Plugin Features
The unittree plugin allows you to:
- Create, modify, duplicate, hierarchize, move, and delete organizational entities
- Search for user accounts in the organizational entity hierarchy
- Assign and remove user accounts from organizational entities
The features of the "Unittree" plugin and its modules (forms-unittree and workflow-unittree) can be combined with the features of the plugins:
- "Forms" for creating forms and managing form responses
- "Workflow" and the "Workflow-forms" module for assigning form responses to organizational entities via workflow tasks.
Configuration of Organizational Entities
To access the organizational entity management page in a Lutece application, go to the "Organizational Entity Management" submenu from the Back Office. When the main page screen appears, by selecting an entity, you can:
- Add/create an entity
- Modify the selected entity
- Delete the selected entity
- Change the location of the selected entity in the organizational entity hierarchy
- View users assigned to the selected entity
- Search for user accounts by filters
- Assign new users
- For each row of a user assigned to the selected entity, you can:
- Move the user (change their assigned entity)
- Remove the user (unassign them from the selected entity)
Creating a New Organizational Entity
From the organizational entity management page:
- Click on the organizational entity that will be the parent of the entity to be created
- Then click on the "+" / "Create an entity" button
- Fill in the fields:
- Code: unique alphanumeric identifier of the organizational entity
- Entity name: label of the organizational entity
- Description: brief presentation of the function of the organizational entity
- Click "Create"
When creating the first organizational entity, it will be positioned under the parent "Root" entity. It automatically becomes the sub-entity of the "Root" entity. By selecting the organizational entity before creating, an organizational hierarchy is defined.
Modifying an Organizational Entity
From the organizational entity management page:
- Click on the organizational entity to be modified
- Then click on the "Modify an entity" button following the "+" button
- Modify the desired fields
- Then click "Modify"
Deleting an Organizational Entity
From the organizational entity management page:
- Click on the organizational entity to be deleted
- Then click on the "Delete an entity" button in red
- Click the "OK" button on the confirmation page that appears. Of course, it is possible to cancel the action from this confirmation page with the "Cancel" button
- Click the "OK" button on the confirmation page that appears when continuing the action to return to the organizational entity management page.
Moving an Organizational Entity in the Organizational Entity Hierarchy
From the organizational entity management page:
- Click on the organizational entity to be moved
- Then click on the "Move an entity" button to the right of the entity deletion button
- On the configuration page that appears, select the entity to which the selected entity will be moved. Then click the "Move" button. Of course, it is possible to cancel the action from this confirmation page with the "Cancel" button
- Click the "OK" button on the confirmation page that appears when continuing the action to return to the organizational entity management page. If the proposed entity list is not the desired one, click the "Up" button to display higher-level entities.
Viewing User Accounts Assigned to an Organizational Entity
When selecting an entity in the organizational entity hierarchy, the "User List" table refreshes to show the user accounts assigned to the selected entity.
Searching for User Accounts in the Organizational Entity Hierarchy
To search for a user account:
- Select the organizational entity in which to search
- From the "User List" table, click the "+ Search" button. The following search criteria are displayed:
- Email: corresponds to the email entered in the user accounts
- First name: corresponds to the first name entered in the user account
- Last name: corresponds to the last name entered in the user accounts
- Search in hierarchy: extends the search to the entire hierarchy. If this box is not checked, the search will be limited to the selected entity.
- Access code: corresponds to the login of the user accounts
- Rights level: filters by one of the rights levels defined in the application
- Status: corresponds to the status of the user accounts (enabled or disabled)
To perform a search:
- Enter one or more search criteria
- Then click the "Search" button to display the searched user account If the "Search in hierarchy" box is checked and the user account is assigned to an entity other than the selected entity, the user is repositioned on the entity to which the user account is assigned.
Assigning Users to Organizational Entities
To assign user accounts to an organizational entity, you need to:
- Click on the organizational entity where you want to assign user accounts
- Click on "+ Assign users"
- On the configuration page that opens, select the user accounts you want to assign to the organizational entity
- either from the available list
- or by searching for them by email
- or by checking the checkbox to the left of the "+ Assign" button to select all users on the entire page
- Then click the "+ Assign" button to validate the action
Moving a User Account in the Organizational Entity Hierarchy
To move an account assigned to an organizational entity:
- Click on the "Move a user" button located in the "Actions" column of the "User List" table
- On the configuration page that appears, select the entity to which the selected entity will be moved. Then click the "Move" button. Of course, it is possible to cancel the action from this confirmation page with the "Cancel" button
Unassigning a User Account from an Organizational Entity
To remove a user account from an organizational entity:
- Click on the "Remove a user" button located in the "Actions" column of the "User List" table
- On the confirmation page that appears, click the "OK" button. Of course, it is possible to cancel the action from this confirmation page with the "Cancel" button
Displaying Form Responses Based on Organizational Entity Configuration
The display of form responses available on the "Form Response Viewing" page can be configured based on organizational entities. It is possible to configure the display on the "Form Response Viewing" page of the tabs:
- All responses: this tab lists all form responses in the application without filtering. This tab is intended for technical or functional administrators.
- Responses from my entity: this tab lists all form responses assigned to the entity of the logged-in user
- Responses from my sub-entities: this tab lists all form responses assigned to the child entities of the logged-in user's assigned entity
This configuration is done via role management. A role can be assigned the control "(forms) Response Viewing Tab" which gives access to the resources:
- My Responses [ forms-userassignment ]: this resource will be used if the workflow tasks "Userassignment" are configured
- Responses from my sub-entities [ forms-unittree-subunit ]
- Responses from my entity [ forms-unittree ]
- All responses [ forms ]
Configuring Form Response Assignment to an Organizational Entity via Workflow Tasks
Form response assignment to organizational entities is done via workflow task configuration. The relevant workflow tasks are:
- (organizational entity) Automatically assign a resource to an entity: once configured, this automatic task is executed when the automatic action is triggered by the automatic task daemon
- (organizational entity) Manually assign a resource to an entity: this manual task allows the Back Office user to trigger it and, according to the configured settings, choose which group the resource will be assigned to.
- (organizational entity) Unassign a resource from entities: this task allows unassigning a response from organizational entities. This task can be integrated into an automatic or manual action.
For the two actions "(organizational entity) Automatically assign a resource to an entity" and "(organizational entity) Manually assign a resource to an entity", it is possible to configure four types of assignment:
- Creation: defines the assignment of form responses upon submission
- Escalation: defines the assignment of form responses to a parent entity
- De-escalation: defines the assignment of form responses to the originating entity
- Transfer: defines the assignment of form responses to a specific entity
For each, it is possible to choose the assignment method to an organizational entity:
assignment method | action type | use case |
Assign to a specific entity | Manual and automatic | Allows configuring the assignment of form responses to any organizational entity |
Assign to the parent entity | Manual and automatic | Allows configuring the assignment of form responses to a parent organizational entity of the current assignment entity |
Assign to the originating entity | Manual and automatic | Allows configuring the assignment of form responses to the originating organizational entity |
Assign to an entity based on defined settings | Manual and automatic | Allows configuring the assignment of form responses to any organizational entity based on a set of rules. These rules can be defined on a multi-choice attribute/field (generic attribute) |
Use Case of Workflow Tasks in Forms Response Management
In the context of using the Forms plugin, it may be necessary to distribute form responses among different teams. In this case, the teams will be implemented as different organizational entities. A workflow associated with a Forms form often includes an initial automatic action that transitions from the initial state to a state called "case instruction". The automatic action leading to this change is first used to notify the user of the successful receipt of their case. In the case of using organizational entities, this first action can use the task "(organizational entity) Automatically assign a resource to an entity" with:
- an assignment type "Creation"
- an assignment to a specific organizational entity or organizational entity based on specific defined settings.
In this example, the form includes a list-type question allowing the user to choose the district in which their request is integrated. The value chosen in the list will allow assignment to an organizational entity.
In the continuation of the workflow, it is possible to plan a set of manual tasks that do not necessarily involve a state change (the same arrival state as the departure state will be chosen) but allow the case to circulate between different organizational entities.
In this workflow, three actions are planned with the starting and ending state "Request received (under review)":
- File transfer, which allows changing the organizational entity manually by selecting the receiving entity in the back office
- Escalation, which assigns to the immediate parent entity
- Return to the originating entity, which directly assigns to the last assigned entity.
These actions are tracked in the history for each response that has undergone a modification.
Examples of Exposed Services
To link the previously presented features with the associated code, here are some examples of exposed services:
Method | Function | Source Code |
---|---|---|
UnitService | Service exposing methods for creating, moving, and retrieving organizational entities | fr.paris.lutece.plugins.unittree.service.unit.UnitService.java |
getAllUnits(boolean) | Retrieve the list of all existing organizational entities. | fr.paris.lutece.plugins.unittree.service.unit.UnitService.java |
getSubUnits | Retrieve the list of sub-entities from the parent entity ID, only at level n+1. | |
getAllSubUnits | Retrieve the list of all sub-entities from the parent entity ID, up to the last level. | |
doCreateUnit | Create an organizational entity | fr.paris.lutece.plugins.unittree.web.UnitJspBean.java |
doMoveSubTree | Move an organizational entity in the hierarchy | |
IUnitAttributeService | Interface to implement if you want to add specific attributes to your project for organizational entities and code the management of these specific entities. Several override methods must be implemented such as: doCreateUnit, doModifyUnit, doRemoveUnit, moveSubTree | fr.paris.lutece.plugins.unittree.service.unit.IUnitAttributeService.java |
IUnitAttributeComponent | Interface to implement if you want to add specific attributes to your project for organizational entities and code the associated specific screen. Several override methods must be implemented such as: fillModel, getTemplate. You will also need to create the associated template (with the added specific attributes). | fr.paris.lutece.plugins.unittree.web.unit.IUnitAttributeComponent.java |
Other Resources (Useful Links, GitHub, etc)
Useful Links
To Go Further…
The unittree plugin can be associated with the following components to add complementary features:
Plugins/Modules | Functionality |
---|---|
module-forms-unitree | Allows assigning form responses to entities based on the value of a response to a question. |
module-workflow-unittree | Allows assigning workflow resources to an organizational entity. |