loopback-component-roles
v1.0.1
Published
Loopback component adding roles management to your User model
Readme
loopback-component-roles
Component for Loopback, adding roles management to your User model.
More about Loopback components here
## Usage
npm install --save loopback-component-rolesIn component-config.json add
"loopback-component-roles": {
"userModel": "MyUser",
"aclModel": "MyACL",
"roleModel": "MyRole",
"roleMappingModel": "MyRoleMapping",
"adminEmail": "[email protected]"
}- Where
My*are the name of your custom models (by default, build-in model will be used). adminEmailis the mail you want for admin account (by default, [email protected])- All options are optional
Warnings
- If you want to see the method added in the explorer, take care of load the
loopback-component-explorerafterloopback-component-rolesincomponent-config.json
What does this component do?
- Create a role
adminif not exist - Create an
adminuser (password by default:admin) if not exist - Give role
admintoadminuser - Create /!\ persisted /!\ ACLs to allow
adminmanipulate roles and users - Add remote methods
addRole,removeRole,findByRole,getAllRoles,getPersistedRolesto User model
