Roles Reader API for 1.8

Warning: This plugin has't been updated in over 7 years. It may no longer be maintained.

What you can do to help:

Provides an API to query user roles (does not provide them)

Last updated
Recommended Releases
Elgg Release Download Date Links
1.81.0 (37.63 kB)2012-Jan-27
Show all releases

Using this plugin will require custom programming. It provides only an API to read and cache a user's role(s) in session, where the roles are provided from Drupal, LimeSurvey, or custom provider classes you create.

Roles are available as an array or as a semicolon-separated string. E.g.

Array format: array(    '__GLOBAL__' => array('admin', 'role1', 'role2'),    'elgg' => array('admin'),    'drupal' => array('role1', 'role2'),)

String form: "admin;role1;role2;elgg:admin;drupal:role1;drupal:role2"

This allows you to search for roles within a specific provider, or from any provider.

Roles are fetched from RoleProvider objects which return an array of roles from a username. By default the Elgg role provider is added, which isn't very exciting (Elgg currently offers only one role: "admin"), but by creating your own classes you could build roles based on any set of conditions.

Also included are classes for fetching roles from Drupal and Limesurvey, and the username mutch match Elgg's in both systems.

Steve Clay

Core Elgg team member, developer for University of Florida College of Education

Project Info

Stats

  • Category: User admin
  • License: Modified BSD license
  • Updated: 2014-11-17
  • Downloads: 705
  • Recommendations: 3

Other Projects

View Steve Clay's plugins