API Docs for: v4.0.0
Show:

Roles Module

Provides functions related to user authorization. Compatible with built-in Meteor accounts packages.

Roles are accessible through Meteor.roles collection and documents consist of:

  • _id: role name
  • children: list of subdocuments:
    • _id

Children list elements are subdocuments so that they can be easier extended in the future or by plugins.

Roles can have multiple parents and can be children (subroles) of multiple roles.

Example: {_id: 'admin', children: [{_id: 'editor'}]}

The assignment of a role to a user is stored in a collection, accessible through RoleAssignmentCollection. It's documents consist of

  • _id: Internal MongoDB id
  • role: A role object which got assigned. Usually only contains the _id property
  • user: A user object, usually only contains the _id property
  • scope: scope name
  • inheritedRoles: A list of all the roles objects inherited by the assigned role.

This module provides the following classes: