• Stars
    star
    418
  • Rank 103,620 (Top 3 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 10 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

sails-permissions

Gitter NPM version Build status Dependency Status

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 --save

Quickstart

Note: Complete documentation available in the sails-permissions wiki: https://github.com/langateam/sails-permissions/wiki

1. configure sailsrc

{
  "generators": {
    "modules": {
      "permissions-api": "sails-permissions/generator"
    }
  }
}

2. run generator

$ sails generate permissions-api

3. Set environment variables

variable description default
ADMIN_USERNAME admin username admin
ADMIN_EMAIL admin user email address [email protected]
ADMIN_PASSWORD admin user password admin1234
e.g in config/local.js (file is in .gitignore)
sails.config.permissions.adminUsername = 'admin'
sails.config.permissions.adminEmail = '[email protected]'
sails.config.permissions.adminPassword = 'admin1234'

4. update configs

config/policies.js

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

  AuthController: {
    '*': [ 'passport' ]
  }

5. Login

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

{
    "identifier": "[email protected]",
    "password": "admin1234"
}

License

MIT

Maintained By

More Repositories

1

trails

🌲 Modern Web Application Framework for Node.js.
JavaScript
1,665
star
2

sails-auth

Passport-based User Authentication system for sails.js applications. Designed to work well with the sails-permissions module.
JavaScript
265
star
3

sails-swagger

Swagger integration for sails.js
JavaScript
107
star
4

trailpack-hapi

📦 Hapi.js Trailpack
JavaScript
19
star
5

doc

📚 Trails.js Documentation
CSS
18
star
6

trailpack

📦 Trailpack Module. All Trailpacks include and inherit this module.
JavaScript
17
star
7

trails-example-app

📗 An example Trails App
JavaScript
14
star
8

trailpack-router

📦 Router. Aggregate and Configure Application Routes.
JavaScript
11
star
9

trailpack-webpack

📦 Webpack Trailpack.
JavaScript
11
star
10

blaze

🔥 Blaze Trails. Create Views automatically from your Models (uses React.js)
10
star
11

trailpack-waterline

📦 Waterline.js Trailpack
JavaScript
8
star
12

trailpack-mongoose

📦 Mongoose.js Trailpack http://mongoosejs.com
JavaScript
8
star
13

trailpack-repl

📦 REPL Trailpack
JavaScript
8
star
14

generator-trailpack

JavaScript
7
star
15

trailpack-sails

📦 Run a Sails.js Application with Trails.
JavaScript
7
star
16

trailpack-microservices

📦 Microservices Trailpack
6
star
17

trailpack-auth

6
star
18

trailpack-swagger

📦 Swagger Trailpack
JavaScript
6
star
19

trailpack-footprints

📦 Footprints Trailpack
JavaScript
6
star
20

trailpack-core

📦 Core Trailpack
JavaScript
6
star
21

trailpack-sequelize

📦 Sequelize.js Trailpack http://sequelizejs.com
JavaScript
5
star
22

eslint-config-trails

:shipit: Trails ESLint Configuration
JavaScript
5
star
23

trailpack-realtime

📦 Realtime Trailpack. Synchronize the client and server via WebSockets
JavaScript
5
star
24

trailpack-autoreload

📦 Reload Trails on Code Changes
JavaScript
5
star
25

trailpack-knex

📦 Knex.js Trailpack
JavaScript
4
star
26

trailpack-bookshelf

📦 Bookshelf.js Trailpack
JavaScript
4
star
27

trailpack-permissions

4
star
28

trailpack-koa

📦 Koa Trailpack
JavaScript
3
star
29

trailpack-bootstrap

📦 bootstrap Trailpack (run a custom startup function in Trails)
JavaScript
3
star
30

smokesignals

🔥 Utilities for testing Trails Applications and Trailpacks
JavaScript
3
star
31

trailpack-tasker

📦 Easily set up background workers with a Message Broker (e.g. RabbitMQ, Kafka)
JavaScript
3
star
32

trailpack-cache

📦 Cache Trailpack
JavaScript
3
star
33

trailpack-fixtures

📦 Fixtures Trailpack. Prime the datastore with an initial dataset.
3
star
34

trailpack-elasticsearch

📦 Elasticsearch Trailpack
JavaScript
3
star
35

art

Trails Branding Materials
2
star
36

trailpack-markdown-doc

📦 Trailpack for Markdown Doc Bundler
JavaScript
2
star
37

trailpack-webserver

📦 Parent to the Web Server Trailpacks (hapi, koa, express4, etc)
JavaScript
2
star
38

trailpack-rethinkdb

Trailspack for https://rethinkdb.com
1
star
39

trails-relay-react-todomvc

TodoMVC Example using Trails, GraphQL, Relay, and React.js
1
star
40

trails-model

🌐 Trails Model Class
JavaScript
1
star
41

generator-util

Trails Generator Utilities
JavaScript
1
star
42

trailsjs.io

🌲 Trails website hosted on Trails
JavaScript
1
star
43

trailpack-typescript

1
star
44

trailpack-agenda

Trailpack for Agenda Job Scheduler - https://github.com/rschmukler/agenda
JavaScript
1
star
45

trailpack-winston

📦 Winston Logging Trailpack
JavaScript
1
star
46

trailsjs.github.io

📚 Trails Website
HTML
1
star
47

trails-todo-app

A todo list app built using Trails and React.js
JavaScript
1
star
48

trailpack-pubsub

Redis Pub/Sub implementation for Trails.js app
JavaScript
1
star
49

org

1
star
50

trailpack-datastore

📦 Parent to the Datastore Trailpacks (waterline, bookshelf, sequelize, etc)
JavaScript
1
star
51

trails-file-upload-example

Describes how to upload files using Trails.
JavaScript
1
star