Loopback component adding roles management to your User model
npm install loopback-component-rolesMore about Loopback components here
## Usage
```
npm install --save loopback-component-rolescomponent-config.json
In add``
"loopback-component-roles": {
"userModel": "MyUser",
"aclModel": "MyACL",
"roleModel": "MyRole",
"roleMappingModel": "MyRoleMapping",
"adminEmail": "admin@mon-domaine.fr"
}My
Where are the name of your custom models (by default, build-in model will be used).adminEmail
* is the mail you want for admin account (by default, test@test.fr)
* All options are optional
after loopback-component-roles
in component-config.jsonWhat does this component do?
* Create a role admin if not exist
* Create an admin user (password by default: admin) if not exist
* Give role admin to admin user
* Create /!\ persisted /!\ ACLs to allow admin manipulate roles and users
* Add remote methods addRole, removeRole, findByRole, getAllRoles, getPersistedRoles` to User model