lib/patch-builder.js
function addPermission() {
  var permission = getPermission(
      mlutil.asArray.apply(null, arguments)
      );
  if (permission === null) {
    throw new Error('permissions.add() takes the role name and one or more insert|update|read|execute capabilities');
  }
  return insert('/array-node("permissions")', 'last-child', permission);
}
function addPermission() {
  var permission = getPermission(
      mlutil.asArray.apply(null, arguments)
      );
  if (permission === null) {
    throw new Error('permissions.add() takes the role name and one or more insert|update|read|execute capabilities');
  }
  return insert('/array-node("permissions")', 'last-child', permission);
}
function addPermission ( ) { var permission = getPermission ( mlutil . asArray . apply ( null , arguments ) ) ; if ( permission === null ) { throw new Error ( 'permissions.add() takes the role name and one or more insert|update|read|execute capabilities' ) ; } return insert ( '/array-node("permissions")' , 'last-child' , permission ) ; }
Specifies operations to patch the permissions of a document.
@namespace patchBuilderPermissions
 
Specifies a role to add to a document's permissions; takes a configuration
object with the following named parameters or, as a shortcut,
a role string and capabilities string or array.
@method patchBuilderPermissions#add
@since 1.0
@param {string} role - the name of a role defined in the server configuration
@param {string|string[]} capabilities - the capability or an array of
capabilities from the insert|update|read|execute enumeration
@returns {patchBuilder.PatchOperation} a patch operation
Specifies operations to patch the permissions of a document .