@webhandle/user-management
v1.0.1
Published
GUI to manage @webhandle/users-data users and groups.
Readme
@webhandle/user-management
GUI to manage @webhandle/users-data users and groups.
Install
npm install @webhandle/user-managementUsage
import userManagementSetup from "@webhandle/user-management/initialize-webhandle-component.mjs"
let userManagementManager = await userManagementSetup(webhandle)Configuration
You can add the following structure to your configuration file:
{
"@webhandle/user-management": {
"usersDreckURLPrefix": "/admin/users"
, "usersTemplatePrefix": "@webhandle/user-management/users/"
, "groupsDreckURLPrefix": "/admin/groups"
, "groupsTemplatePrefix": "@webhandle/user-management/groups/"
, "locals": {
"pretemplate": "app_pre",
"posttemplate": "app_post"
}
}
}However, authorization works a little bit differently. By default, only users from the "administrators" group are allowed to access the interface. This can be change like:
userManagementManager.config.authorization = (req, res, next) => {
next()
}The above code would allow anybody to access the screens.
Exposed Information
The configuration that was used to set up the component
userManagementManager.configThe middleware function which authorizes users to the screens
userManagementManager.config.autorizationInstances of the Dreck class which orchestrates CRUD user interface operations.
userManagementManager.drecks.groups
userManagementManager.drecks.groupsFunction to add dependencies to the page. This is called automatically by this component. It can be changed at any time if more resources are needed for the page.
userManagementManager.addExternalResources(externalResourceManager)