From 1694ee2d835fe476fcf07ff15e398ec5be5f8fe3 Mon Sep 17 00:00:00 2001 From: crandmck Date: Mon, 9 Jun 2014 15:36:08 -0700 Subject: [PATCH] JSDoc cleanup --- lib/models/acl.js | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/lib/models/acl.js b/lib/models/acl.js index b29b3e63..a10cfbbc 100644 --- a/lib/models/acl.js +++ b/lib/models/acl.js @@ -61,6 +61,7 @@ var ACLSchema = { /** * Name of the access type - READ/WRITE/EXEC + * @property accessType {String} Name of the access type - READ/WRITE/EXEC */ accessType: String, @@ -114,7 +115,7 @@ ACL.SCOPE = Principal.SCOPE; * Calculate the matching score for the given rule and request * @param {ACL} rule The ACL entry * @param {AccessRequest} req The request - * @returns {number} + * @returns {Number} */ ACL.getMatchingScore = function getMatchingScore(rule, req) { var props = ['model', 'property', 'accessType']; @@ -296,14 +297,12 @@ ACL.getStaticACLs = function getStaticACLs(model, property) { /** * Check if the given principal is allowed to access the model/property - * @param {String} principalType The principal type - * @param {String} principalId The principal id - * @param {String} model The model name - * @param {String} property The property/method/relation name - * @param {String} accessType The access type - * @param {Function} callback The callback function - * - * @callback callback + * @param {String} principalType The principal type. + * @param {String} principalId The principal ID. + * @param {String} model The model name. + * @param {String} property The property/method/relation name. + * @param {String} accessType The access type. + * @callback {Function} callback Callback function. * @param {String|Error} err The error object * @param {AccessRequest} result The access permission */ @@ -364,14 +363,14 @@ ACL.prototype.debug = function() { } /** - * Check if the request has the permission to access - * @param {Object} context - * @property {Object[]} principals An array of principals - * @property {String|Model} model The model name or model class - * @property {*} id The model instance id - * @property {String} property The property/method/relation name - * @property {String} accessType The access type - * @param {Function} callback + * Check if the request has the permission to access. + * @options {Object} context See below. + * @property {Object[]} principals An array of principals. + * @property {String|Model} model The model name or model class. + * @property {*} id The model instance ID. + * @property {String} property The property/method/relation name. + * @property {String} accessType The access type: READE, WRITE, or EXEC. + * @param {Function} callback Callback function */ ACL.checkAccessForContext = function (context, callback) { @@ -452,8 +451,7 @@ ACL.checkAccessForContext = function (context, callback) { * @param {String} model The model name * @param {*} modelId The model id * @param {String} method The method name - * @end - * @callback {Function} callback + * @callback {Function} callback Callback function * @param {String|Error} err The error object * @param {Boolean} allowed is the request allowed */