Child pages
  • Organizational Identity Source Plugins

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. groupableAttributes() defines the set of attributes the Plugin knows about that may be used for generating group memberships. This may be a static list of attributes, or (as of v3.1.0) it may be dynamically determined based on a given instantiation (via the configuration available in $this->pluginCfg).
  2. resultToGroups() converts a raw result into an array of attribute value/pairs. Note the array is not itself the group mapping, but rather the relevant attributes that will be used by the core code to determine if any group membership match. (This way the Plugin does not need to worry about parsing the mapping configuration.)

...

Info

Prior to v3.2.0, the resultToGroups() was poorly specified, allowing either a single value or a list of values. Beginning with v3.2.0, the interface has been clarified, and the result is now an array where the key is the attribute and the value is a list of array, each of which may contain the following keys: value (required, holds the actual value), valid_from, and valid_through. If specified, the latter two must be in strftime %F %T format, and in UTC.

Note that while it is possible for a backend to return multiple entries for the same group with different validity dates, these must be consolidated down to a single CoGroupMember record. (While the data format theoretically allows multiple CoGroupMember records for the same CO Person in the same CO Group with different validity windows, in practice this is not supported anywhere.) If multiple entries are found, the group membership mapping code will attempt to pick the "best" one, which is generally the current record, or the one with the latest valid through date. Plugins can implement more deterministic algorithms by setting the results from resultToGroups() appropriately.

Example

Code Block
languagephp
public function groupableAttributes() {
  return array(
    'title' => _txt('fd.title');
  );
}


public function resultToGroups($raw) {
  // The core code will use this data to determine if the configured 
  // OIS Group Mapping rules are matched.

   return array(
    'title' => array(
      array(
        'value' => 'Professor of Mysterious Events',
        'valid_from' => '2017-08-01 00:00:00',
        'valid_through' => '2018-07-31 23:59:59'
      );
    );
  );
}

...