Constructor
new Groups(opts)
Creates a Groups object.
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
opts |
object | The configuration options. Properties
|
- 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