0.1.18 • Published 10 years ago

jrpcsec-node-client v0.1.18

Weekly downloads
2
License
ISC
Repository
github
Last release
10 years ago

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: 'joes-group@example.com'
        };
        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

ParamTypeDescription
paramsObjectinvocation parameters
params.memberSelectorstring
params.memberPasswordstring
callbackmeteorLoginWithFooCBinvoked 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

ParamTypeDescription
paramsObjectinvocation parameters
params.accountSelectorstring
params.accountAdminEmailemail
params.accountAdminPasswordstring
callbackgroupAccountsCBinvoked 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

ParamTypeDescription
paramsobjectparameters to configure
params.pendingLimitnumber
callbackgroupAccountsCBinvoked 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

ParamTypeDescription
paramsobjectparameters
params.accountSelectorstring
params.memberSelectorstring
params.memberPasswordstring
callbackgroupAccountsCBinvoked 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

ParamTypeDescription
paramsobjectparameters
params.memberSelectorstring
callbackgroupAccountsCBinvoked 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

ParamTypeDescription
paramsObjectinvocation parameters
params.memberSelectorstring
callbackgroupAccountsCBinvoked 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

ParamTypeDescription
paramsObjectinvocation parameters
params.memberSelectorstring
callbackgroupAccountsCBinvoked 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.

ParamTypeDescription
paramsObjectinvocation parameters
params.accountSelectorstring
params.memberSelectorstring
callbackgroupAccountsCBinvoked 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

ParamTypeDescription
errMeteor.Errorundefined 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

ParamTypeDescription
errMeteor.Errorundefined on successful invocation
resultObjectvaries

groupaccount~groupAccountStatusObject : Object

A group account probe status object.

Kind: inner typedef of groupaccount Properties

NameType
validNewGroupboolean
validOldGroupboolean
validNewMemberboolean
validOldMemberboolean
membershipOpenboolean

© 2015-2016 Verody, LLC.

0.1.18

10 years ago

0.1.17

10 years ago

0.1.16

10 years ago

0.1.15

10 years ago

0.1.14

10 years ago

0.1.13

10 years ago

0.1.12

10 years ago

0.1.11

10 years ago

0.1.10

10 years ago

0.1.9

10 years ago

0.1.8

10 years ago

0.1.7

10 years ago

0.1.6

10 years ago

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago