Remove duplicate cb func from getRoles and other doc cleanup

This commit is contained in:
crandmck 2015-03-12 11:15:36 -07:00
parent 131633f50d
commit 1cabd74308
1 changed files with 21 additions and 19 deletions

View File

@ -9,8 +9,9 @@ var RoleMapping = loopback.RoleMapping;
assert(RoleMapping, 'RoleMapping model must be defined before Role model'); assert(RoleMapping, 'RoleMapping model must be defined before Role model');
/** /**
* The Role Model * The Role model
* @class Role * @class Role
* @header Role object
*/ */
module.exports = function(Role) { module.exports = function(Role) {
@ -113,7 +114,7 @@ module.exports = function(Role) {
} }
/*! /*!
* Check if two user ids matches * Check if two user IDs matches
* @param {*} id1 * @param {*} id1
* @param {*} id2 * @param {*} id2
* @returns {boolean} * @returns {boolean}
@ -201,11 +202,12 @@ module.exports = function(Role) {
}); });
/** /**
* Check if the user id is authenticated * Check if the user ID is authenticated
* @param {Object} context The security context * @param {Object} context The security context.
* @callback {Function} callback *
* @param {Error} err * @callback {Function} callback Callback function.
* @param {Boolean} isAuthenticated * @param {Error} err Error object.
* @param {Boolean} isAuthenticated True if the user is authenticated.
*/ */
Role.isAuthenticated = function isAuthenticated(context, callback) { Role.isAuthenticated = function isAuthenticated(context, callback) {
process.nextTick(function() { process.nextTick(function() {
@ -226,13 +228,14 @@ module.exports = function(Role) {
}); });
/** /**
* Check if a given principal is in the role * Check if a given principal is in the specified role.
* *
* @param {String} role The role name * @param {String} role The role name.
* @param {Object} context The context object * @param {Object} context The context object.
* @callback {Function} callback *
* @param {Error} err * @callback {Function} callback Callback function.
* @param {Boolean} isInRole * @param {Error} err Error object.
* @param {Boolean} isInRole True if the principal is in the specified role.
*/ */
Role.isInRole = function(role, context, callback) { Role.isInRole = function(role, context, callback) {
if (!(context instanceof AccessContext)) { if (!(context instanceof AccessContext)) {
@ -317,13 +320,12 @@ module.exports = function(Role) {
}; };
/** /**
* List roles for a given principal * List roles for a given principal.
* @param {Object} context The security context * @param {Object} context The security context.
* @param {Function} callback
* *
* @callback {Function} callback * @callback {Function} callback Callback function.
* @param {Error=} err * @param {Error} err Error object.
* @param {String[]} roles An array of role ids * @param {String[]} roles An array of role IDs
*/ */
Role.getRoles = function(context, callback) { Role.getRoles = function(context, callback) {
if (!(context instanceof AccessContext)) { if (!(context instanceof AccessContext)) {