UNPKG

sails-permissions-sequelize

Version:

Sequelize version of : 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.

44 lines (41 loc) 963 B
/** * @module Model * * @description * Abstract representation of a Waterline Model. */ 'use strict'; module.exports = { description: 'Represents a Waterline collection that a User can create, query, etc.', autoPK: true, autoCreatedBy: false, autoCreatedAt: false, autoUpdatedAt: false, attributes: { name: { type: Sequelize.STRING, allowNull: false, unique: true }, identity: { type: Sequelize.STRING, notNull: true }, attributes: { type: Sequelize.JSON } // permissions: { // collection: 'Permission', // via: 'model' // }, }, associate: function associate() { Model.hasMany(Permissions, { as: 'permissions' }); }, options: { tableName: 'model', classMethods: {}, instanceMethods: {}, hooks: {} } };