This is the documentation for concrete5 version 5.6 and earlier. View Current Documentation

Here's quick snippet for assigning a group "Access User Search" permission.

$groupName = 'Superstars';  // change to the group you need
$taskPermissionHandle = 'access_user_search';
$group = Group::getByName($groupName);
$pk    = UserPermissionKey::getByHandle($taskPermissionHandle);
$pao   = $pk->getPermissionAssignmentObject();
$pa    = PermissionAccess::getByID($pk->getPermissionAccessID(), $pk)->duplicate();
$pae   = GroupPermissionAccessEntity::getOrCreate($group);
$pa->addListItem($pae, false, PermissionKey::ACCESS_TYPE_INCLUDE);
$pa->save(array('paID' => $pa->getPermissionAccessID()));
$pao->assignPermissionAccess($pa);
Loading Conversation