Accounts

Accounts

Source:

Accounts core plugin: Manage how members sign into your shop

Classes

AdminInviteForm

React component to display admin invite form

EditGroup

React component to display edit group panel

LoginInline

React component to log in form in line

OrdersList

React component to display an array of completed orders

SignIn

React component to display sign in form

Methods

(static) addProvider(provider, fields)

Add an OAuth provider, with field definitions required to render the form which collects and stores configuation settings for the provider.

Source:
See:
Example
ServiceConfigHelper.addProvider("Untappd", [{ property: "clientId", label: "Client ID" }]), { property:
 "secret", label: "Client Secret" }]);
Parameters:
Name Type Description
provider string

Display Name of the provider

fields Array.<object>

Array of plain old JavaScript objects with the keys property ("apiKey", for example. apiKey should correspond to your OAuth provider's implementation) and label ("API Key", for example)

(static) capitalize(str) → {String}

Client-side helper to capitalize word

Source:
Parameters:
Name Type Description
str String

String to capitalize

Returns:

First letter of first word capitalized

Type
String

(static) getDefaultUserInviteGroup(groups) → {Object}

user's default invite groups is the group they belong if the user belongs to owner group, it defaults to shop manager (because you cannot invite directly to an existing shop as owner). If no match still, use the first of the groups passed (e.g in case of Marketplace owner accessing a merchant shop)

Source:
Parameters:
Name Type Description
groups Array

[description]

Returns:

[description]

Type
Object

(static) getInvitableGroups(groups) → {Array}

helper - client This generates a list of groups the user can invite to. It filters out the owner group (because you cannot invite directly to an existing shop as owner) It also filters out groups that the user does not have needed permissions to invite to. All these are also checked by the Meteor method, so this is done to prevent trying to invite and getting error

Source:
Parameters:
Name Type Description
groups Array

list of user account objects

Returns:
  • array of groups or empty object
Type
Array

(static) getTargetAccount() → {Object}

gets the account of the userId in the route, or the current user.

Source:
Since:
  • 1.5.0
Returns:
  • the account of the identified user.
Type
Object

(static) getUserAvatar(currentUser) → {Component}

ReactionAvatar Component helper to get a user's Avatar

Source:
Example
const userAvatar = getUserAvatar(account);
Parameters:
Name Type Description
currentUser Object

User

Returns:

ReactionAvatar component

Type
Component

(static) groupPermissions(packages) → {Object}

Return all permissions for packages

Source:
To Do:
  • Review hardcoded `reaction` in package names
Parameters:
Name Type Description
packages Array

[description]

Returns:

[description]

Type
Object

(static) GroupsTableButton(props) → {Node}

React stateless component for "remove from group" button for groupTable

Source:
Properties:
Name Type Description
account Object

User account object

group Object

Group data

handleRemoveUserFromGroup function

function to call on button click

hasPermissions Boolean

true or false depending on if user is granted access

Example
<Components.GroupsTableButton {...{ account, group, handleRemoveUserFromGroup }} />
Parameters:
Name Type Description
props Object

React PropTypes

Returns:

React node containing wrapped button

Type
Node

(static) hasError(error) → {String}

Check to see if there are error or other messages to display

Source:
Parameters:
Name Type Description
error Object

Error

Returns:

"has-error has-feedback" string

Type
String

(static) hasPermission(user, permissions, roleGroupopt) → {Boolean}

Source:
Parameters:
Name Type Attributes Description
user Object

The user object, with roles property, to check.

permissions Array.<String>

Array of permission strings. The account must have at least one of them either globally or for the roleGroup.

roleGroup String <optional>

The shop ID for which the permissions are needed, or a more specific roles group. If not set, only global roles will be checked.

Returns:

True if the account with ID accountId has at least one of the requested permissions in the roleGroup group

Type
Boolean

(static) isOwnerOfProfile() → {Boolean}

checks whether or not the user viewing this profile is also its owner.

Source:
Since:
  • 1.5.0
Returns:
  • whether or not the current user is also this profile's owner.
Type
Boolean

(static) messages() → {Object}

Source:
Returns:

Message object

Type
Object

(static) sortGroups(groups) → {Array}

Sort to display higher permission groups and "owner" at the top

Source:
Parameters:
Name Type Description
groups Array

[description]

Returns:

[description]

Type
Array

(static) sortUsersIntoGroups(accounts, groups) → {Array}

helper - client puts each full user object into an array on the group they belong

Source:
Parameters:
Name Type Description
accounts Array

list of user account objects

groups Array

list of permission groups

Returns:
  • array of groups, each having a users field
Type
Array