Use the groupaccount
packages to provide qualified access to a single Meteor account from one or more sets of credentials:
groupaccount
- Provides the core, server-side functionality, along with some client-side wrappers and helpers.groupaccount-signin
- Provides an unstyled, reactive signin UI templategroupaccount-manager
- Provides an unstyled, reactive management UI templategroupaccount-cyclejs
- Provides an xstream-based UI component
accountSelector
: a globally-unique identifier for the account. Associated with a singleMeteor.user
memberSelector
: locally-unique identifier for someone allowed to read/write some or all data associated with the group
Add the core package thus:
meteor add verody:groupaccount
meteor test-packages --driver-package practicalmeteor:mocha ./packages/groupaccount/
Callback functions for the GroupAccounts.*
methods all have the same signature and return semantics:
var params = {
accountAdminPassword: 'thisIsASeriousPassword',
accountSelector: 'joes-group-account',
accountAdminEmail: '[email protected]'
};
GroupAccounts.createAccount (params, function (err,res) {
//
// err is undefined on successful invocation.
// res is the Meteor.userId for the new account.
console.log ('[groupaccount test createAccount CB]', res, err);
});
The callback for Meteor.loginWithGroupAccount follows the convention for the Meteor.loginWith* methods:
var params = {
accountSelector: 'joes-group-account',
memberSelector: 'admin',
memberPassword: 'thisIsASeriousPassword'
};
Meteor.loginWithGroupAccount (params, function (err) {
//
// err is undefined on successful invocation.
console.log ('[groupaccount test loginWithGroupAccount CB]', err);
});
Also, take a look at the examples on github here (Blaze+Bootstrap3)
, and here (Cycle.js+Bootstrap3)
- member roles to facilitate access control to portions of the
Meteor.user()
data.
- groupaccount
~Meteor
:object
~GroupAccounts
:object
~meteorLoginWithFooCB
:function
~groupAccountsCB
:function
~groupAccountStatusObject
:Object
Kind: inner namespace of groupaccount
Log in to existing group account. Fails if member activation is pending. Asynchronous.
Kind: static method of Meteor
Param | Type | Description |
---|---|---|
params | Object |
invocation parameters |
params.memberSelector | string |
|
params.memberPassword | string |
|
callback | meteorLoginWithFooCB |
invoked upon completion |
Kind: inner namespace of groupaccount
~GroupAccounts
:object
Creates a new group account via asynchronous server method invocation Callback throws an error, or returns a Meteor.users document
Kind: static method of GroupAccounts
Param | Type | Description |
---|---|---|
params | Object |
invocation parameters |
params.accountSelector | string |
|
params.accountAdminEmail | email |
|
params.accountAdminPassword | string |
|
callback | groupAccountsCB |
invoked upon completion |
Reports, and optionally modifies, configuration paramters for currently-logged-in group account. Asynchronous. On success, callback returns the current (and possibly updated) configuration parameters.
Kind: static method of GroupAccounts
Param | Type | Description |
---|---|---|
params | object |
parameters to configure |
[params.pendingLimit] | number |
|
callback | groupAccountsCB |
invoked upon completion |
Adds a new member to existing group. Asynchronous. On success callback returns a Meteor.users document ID for this group account
Kind: static method of GroupAccounts
Param | Type | Description |
---|---|---|
params | object |
parameters |
params.accountSelector | string |
|
params.memberSelector | string |
|
params.memberPassword | string |
|
callback | groupAccountsCB |
invoked upon completion |
Removes an existing existing user from a group. Must be logged in to group account. Asynchronous. On success, callback returns a Meteor.users document for this group account
Kind: static method of GroupAccounts
Param | Type | Description |
---|---|---|
params | object |
parameters |
params.memberSelector | string |
|
callback | groupAccountsCB |
invoked upon completion |
Activates a new group member. Must be logged in to group account. Asynchronous. On success, callback returns the Meteor.Users doument ID for this group account.
Kind: static method of GroupAccounts
Param | Type | Description |
---|---|---|
params | Object |
invocation parameters |
params.memberSelector | string |
|
callback | groupAccountsCB |
invoked upon completion |
Dectivates a group member. Must be logged in to group account. Asynchronous. On success, callback returns the Meteor.Users doument ID for this group account.
Kind: static method of GroupAccounts
Param | Type | Description |
---|---|---|
params | Object |
invocation parameters |
params.memberSelector | string |
|
callback | groupAccountsCB |
invoked upon completion |
Throttled probe of group account and, optionally, a group member. Asynchronous. On success, callback returns a status object for the group acccount.
Kind: static method of GroupAccounts
Returns: groupAccountStatusObject
- Well, the callback returns one of these, if it wants.
Param | Type | Description |
---|---|---|
params | Object |
invocation parameters |
params.accountSelector | string |
|
[params.memberSelector] | string |
|
callback | groupAccountsCB |
invoked upon completion |
Callback functions for the MeteorLoginWith* methods. Returns a Meteor.Error on early failure. Otherwise, returns an object with userId set to Meteor.users document ID for this group account, and perhaps error set to a Meteor.Error.
Kind: inner typedef of groupaccount
Param | Type | Description |
---|---|---|
err | Meteor.Error |
undefined on successful invocation |
Callback functions for the GroupAccounts.* methods all have the same signature and return semantics.
Kind: inner typedef of groupaccount
Param | Type | Description |
---|---|---|
err | Meteor.Error |
undefined on successful invocation |
result | Object |
varies |
A group account probe status object.
Kind: inner typedef of groupaccount
Properties
Name | Type |
---|---|
validNewGroup | boolean |
validOldGroup | boolean |
validNewMember | boolean |
validOldMember | boolean |
membershipOpen | boolean |
© 2015-2016 Verody, LLC.