A constraint in Multicolour is a simple string in your models to define a limiting behaviour on for certain types of actions, such as making sure when something is created it gets assigned the logged in user’s identifier for ownership.
ComparativeString is a
String with the following format:
ConstraintObject is an
Object with the following format:
Example and common uses
The most common constraint is ensuring a user has sufficient privileges to read/write something and would come in the form of
The way this works is the
String is a path to an object on the
request object, this is in-fact setting the constraint to the value of
request.auth.credentials.user.id in the incoming request.
Verbs and constraints
You must specify your constraints on all the http verbs you wish to constrain. The verbs must appear as lowercase.