Package Exports
- sails-permissions
- sails-permissions/api/controllers/AuthController
- sails-permissions/api/controllers/ModelController
- sails-permissions/api/controllers/PermissionController
- sails-permissions/api/controllers/RoleController
- sails-permissions/api/controllers/UserController
- sails-permissions/api/hooks/sails-permissions
- sails-permissions/api/models/Model
- sails-permissions/api/models/Passport
- sails-permissions/api/models/Permission
- sails-permissions/api/models/Role
- sails-permissions/api/models/User
- sails-permissions/api/policies/ModelPolicy
- sails-permissions/api/policies/OwnerPolicy
- sails-permissions/api/policies/PermissionPolicy
- sails-permissions/api/policies/RolePolicy
- sails-permissions/api/policies/basicAuth
- sails-permissions/api/policies/passport
- sails-permissions/api/services/ModelService
- sails-permissions/api/services/PermissionService
- sails-permissions/api/services/passport
- sails-permissions/api/services/protocols/local
- sails-permissions/api/services/protocols/oauth
- sails-permissions/api/services/protocols/oauth2
- sails-permissions/api/services/protocols/openid
- sails-permissions/config/passport
- sails-permissions/config/permissions
- sails-permissions/config/routes/sails-auth
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (sails-permissions) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
-permissions
Comprehensive sails.js user permissions and entitlements system. Supports user authentication with passport.js, role-based permissioning, object ownership, and row-level security.
Install
$ npm install sails-permissions sails-auth --saveQuickstart
Note: Complete documentation available in the sails-permissions wiki: https://github.com/tjwebb/sails-permissions/wiki
1. configure sailsrc
{
"generators": {
"modules": {
"permissions-api": "sails-permissions/generator"
}
}
}2. run generator
$ sails generate permissions-api3. Set environment variables
| variable | description | default |
|---|---|---|
ADMIN_USERNAME |
admin username | admin |
ADMIN_EMAIL |
admin user email address | admin@example.com |
ADMIN_PASSWORD |
admin user password | admin1234 |
4. update configs
config/policies.js
'*': [
'basicAuth',
'passport',
'sessionAuth',
'ModelPolicy',
'AuditPolicy',
'OwnerPolicy',
'PermissionPolicy',
'RolePolicy',
'CriteriaPolicy'
],
AuthController: {
'*': [ 'passport' ]
}License
MIT
Maintained By
