API:isMemberOfWebGroup

From MODx Wiki

Jump to: navigation, search
 API Function Definition: 
isMemberOfWebGroup
Versions 
> 0.9.2 ?
Return Values
Success: true
Fail: false
Data Type 
bool
Object Hierarchy 
DocumentParser
bool isMemberOfWebGroup(array $groupNames);


Checks to see if the currently logged in user is a part of the specified group names. The single parameter is an array of group names (not ids) to check for membership in.

Examples

$test = $modx->isMemberOfWebGroup( array(
	'Editors'
));
if ($test === true) {
	// Is a member of the group
} else {
	// Is not a member of the group
}

Related Functions

Function Source

File: manager/includes/document.parser.class.inc.php
Line: 2138


Notes

  • If $groupNames is not an array, this function will return boolean false.
  • As of MODx 0.9.6, there is no API Function to check for Manager User Group Access. Use getUserDocGroups() to check for Manager Group Membership.
Personal tools