Class: Groups

Groups(opts)

The Groups class allows to work with groups on a Nuxeo Platform instance.

Cannot directly be instantiated

Constructor

new Groups(opts)

Creates a Groups object.

Parameters:
Name Type Description
opts object

The configuration options.

Properties
Name Type Description
nuxeo string

The Nuxeo object linked to this Groups object.

Source:
Example
var Nuxeo = require('nuxeo')
var nuxeo = new Nuxeo({
 baseURL: 'http://localhost:8080/nuxeo',
 auth: {
   method: 'basic',
   username: 'Administrator',
   password: 'Administrator'
 }
});
nuxeo.groups()
  .fetch('administrators')
  .then(function(res) {
    // res.groupname === 'administrators'
    // res.grouplabel === 'Administrators group'
  })
  .catch(function(error) {
    throw new Error(error));
  });

Methods

create(user, optsopt) → {Promise}

Creates a group.

Parameters:
Name Type Attributes Description
user object

The group to be created.

opts object <optional>

Options overriding the ones from this object.

Source:
Returns:

A Promise object resolved with the created Group.

Type
Promise

delete(groupname, optsopt) → {Promise}

Deletes a group given a groupname.

Parameters:
Name Type Attributes Description
groupname string

The groupname.

opts object <optional>

Options overriding the ones from this object.

Source:
Returns:

A Promise object resolved with the result of the DELETE request.

Type
Promise

fetch(groupname, optsopt) → {Promise}

Fetches a group given a groupname.

Parameters:
Name Type Attributes Description
groupname string

The groupname.

opts object <optional>

Options overriding the ones from this object.

Source:
Returns:

A Promise object resolved with the Group.

Type
Promise

update(group, optsopt) → {Promise}

Updates a group. Assumes that the group object has an groupname field.

Parameters:
Name Type Attributes Description
group object

The group to be updated.

opts object <optional>

Options overriding the ones from this object.

Source:
Returns:

A Promise object resolved with the updated Group.

Type
Promise