@inspire-platform/sails-hook-permissions
Version:
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.
32 lines (31 loc) • 914 B
JavaScript
/**
* @module Criteria
*
* @description
* Criteria specify limits on a permission, via a 'where' clause and an attribute blacklist.
* For the blacklist, if the request action is update or create, and there is a blacklisted attribute in the request,
* the request will fail. If the request action is read, the blacklisted attributes will be filtered.
* The blacklist is not relevant for delete requests.
* A where clause uses waterline query syntax to determine if a permission is allowed, ie where: { id: { '>': 5 } }
*/
module.exports = {
autoCreatedBy: false,
description: 'Specifies more granular limits on a permission',
attributes: {
id: {
type: 'number',
autoIncrement: true
},
where: {
type: 'json',
columnType: 'json'
},
blacklist: {
type: 'json',
columnType: 'json'
},
permission: {
model: 'Permission'
}
}
};