Neurotic Pantaloon Maker

    @inspire-platform/sails-hook-permissions

    2.0.0-15-hf1 • Public • Published

    @inspire-platform/sails-hook-permissions

    NPM version

    Comprehensive sails.js user permissions and entitlements system. Supports user authentication with passport.js, role-based permissioning, object ownership, and row-level security.

    Contents

    Install

    $ npm install @inspire-platform/sails-hook-permissions --save

    Quickstart

    1. configure sailsrc

    {
      "generators": {
        "modules": {
          "permissions-api": "@inspire-platform/sails-hook-permissions/generator"
        }
      }
    }

    2. run generator

    WARNING! The generator is not currently up to date with the 2.x.x releases.

    $ sails generate permissions-api

    3. Manual configuration

    Env vars

    variable description default
    ADMIN_USERNAME admin username admin
    ADMIN_EMAIL admin user email address admin@example.com
    ADMIN_PASSWORD admin user password admin1234

    config/permissions.js (or config/local.js)

    ...
    permissions: {
      adminUser: {
        username: 'admin',
        email: 'admin@example.com',
        password: 'admin1234'
        // add custom fields here if your model requires them
      }
    },
    ...

    config/policies.js

    '*': [
      'basicAuth',
      'passport',
      'sessionAuth',
      'ModelPolicy',
      'AuditPolicy',
      'OwnerPolicy',
      'PermissionPolicy',
      'RolePolicy',
      'CriteriaPolicy'
    ],
    
    AuthController: {
      '*': [ 'passport' ]
    }

    4. Login

    You can now login using the aforementioned default login data or the admin settings you specified using the /auth/local endpoint.

    {
        "identifier": "admin@example.com",
        "password": "admin1234"
    }

    License

    MIT

    Install

    npm i @inspire-platform/sails-hook-permissions

    DownloadsWeekly Downloads

    0

    Version

    2.0.0-15-hf1

    License

    MIT

    Unpacked Size

    264 kB

    Total Files

    106

    Last publish

    Collaborators

    • donatoaz
    • inspireplatform
    • mrmaz
    • eduardosmoura
    • gabrielconcepta
    • thiagosouza