Skip to content

Conceptual Overview

Ryan Quinn edited this page Jul 7, 2015 · 4 revisions

permissions

Overview

A User is allowed to perform an action on an object if they have a Role which has the requested Permission.

Permission

A Permission grants a Role the ability to perform a particular action on a Model. A Permission can optionally have Criteria.

Criteria

A Criteria is an optional extension of a Permission. It can have either a blacklist, a 'where' clause, or both. A 'where' clause limits the scope of the Permission, and a blacklist disallows action on the specified model attributes. There is a one-to-many relationship between Permission and Criteria.

Action

An action can be one of:

  • create
  • read
  • update
  • delete

Model

A Model is one of your defined Waterline collections; in sails.js, these are the modules inside api/models.

Role

Role links a User to a group of Permission. Many Users can share the same Role.

A Permission can only be granted to a single Role. (Permission->Role is many->one) For example, if two Roles want to permit the same action, two Permission objects must be created.

Clone this wiki locally