You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 6, 2021. It is now read-only.
Copy file name to clipboardExpand all lines: templates/advanced/api/blueprints/_util/actionUtil.js
-38Lines changed: 0 additions & 38 deletions
Original file line number
Diff line number
Diff line change
@@ -38,42 +38,6 @@ module.exports = {
38
38
returnassociations;
39
39
},
40
40
41
-
/**
42
-
* AccessControl proxy function, expects a Waterline query object for before* hooks and an array of records for after* hooks.
43
-
* @param {Collection} model Waterline collectio, from parseModel
44
-
* @param {String} action blueprint or hook, e.g. beforeFind, afterFind, beforeCreate, afterCreate --> translates to accessControlBeforeFind, etc.
45
-
* @param {Object} options Options: query {Query} Waterline query object for before* hooks, records: {Array} records for after* hooks, {Model} current user record
46
-
* @return {Query|Array} returns the modified query (with altered criteria) for before* or the filtered/extended record array for after*.
}elseif(action.indexOf("after")===0){// turns out that access control after querying the database is a bad idea, because counting and pagination patterns are broken
console.log("Dev: Model "+model.identity+" is missing control "+action+"!");
70
-
if(callback){
71
-
callback(null,primaryArgument);
72
-
}
73
-
}
74
-
returnprimaryArgument;
75
-
},
76
-
77
41
/**
78
42
* helper function to populate a record with an array for indexes for associated models, running various Waterline queries on the join tables if neccessary ( defined as: include -> index )
0 commit comments