Skip to content
This repository has been archived by the owner on Nov 2, 2019. It is now read-only.
/ meteor-groupaccount Public archive

Use groupaccount to provide qualified access to a single Meteor account from one or more sets of credentials.

License

Notifications You must be signed in to change notification settings

ekobi/meteor-groupaccount

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

98 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CircleCI

groupaccount

Use the groupaccount packages to provide qualified access to a single Meteor account from one or more sets of credentials:

  1. groupaccount - Provides the core, server-side functionality, along with some client-side wrappers and helpers.
  2. groupaccount-signin - Provides an unstyled, reactive signin UI template
  3. groupaccount-manager - Provides an unstyled, reactive management UI template
  4. groupaccount-cyclejs - Provides an xstream-based UI component

Some helpful definitions

  • accountSelector : a globally-unique identifier for the account. Associated with a single Meteor.user
  • memberSelector : locally-unique identifier for someone allowed to read/write some or all data associated with the group

Usage

Add the core package thus:

meteor add verody:groupaccount

Core package testing

meteor test-packages --driver-package practicalmeteor:mocha ./packages/groupaccount/

Examples

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)

Pipeline

  • member roles to facilitate access control to portions of the Meteor.user() data.

API Reference

groupaccount~Meteor : object

Kind: inner namespace of groupaccount

Meteor.loginWithGroupAccount(params, callback)

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

groupaccount~GroupAccounts : object

Kind: inner namespace of groupaccount

GroupAccounts.createAccount(params, callback)

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

GroupAccounts.configure(params, callback)

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

GroupAccounts.joinGroup(params, callback)

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

GroupAccounts.removeMember(params, callback)

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

GroupAccounts.activateMember(params, callback)

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

GroupAccounts.deactivateMember(params, callback)

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

GroupAccounts.probe(params, callback)groupAccountStatusObject

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

groupaccount~meteorLoginWithFooCB : function

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

groupaccount~groupAccountsCB : function

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

groupaccount~groupAccountStatusObject : Object

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.

About

Use groupaccount to provide qualified access to a single Meteor account from one or more sets of credentials.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published