modUser.getResourceGroups
Последнее обновление not available | История страницы | Улучшить эту страницу | Сообщить о проблеме
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$194 per month—let's make that $500!
Learn moremodUser::getResourceGroups¶
Возвращает id групп ресурсов, доступных пользователю в заданном Context. Пустой $ctx означает текущий Context.
Значения приходят из записи сеанса, которую пишет modAccessResourceGroup::loadAttributes(). Записи нет — атрибуты принудительно перезагружаются, после чего чтение повторяется. Без доступа к группам ресурсов массив остаётся пустым. Внутри лежат id, а не имена: modResourceGroup::hasAccess() сравнивает их со своим id.
Синтаксис¶
array getResourceGroups ([string $ctx = ''])
-
$ctx(string) Ключ Context, для которого нужна проверка, по умолчанию''— текущий Context.
Пример¶
$groups = $user->getResourceGroups('web');
foreach ($groups as $groupId) {
echo $groupId;
}
Смотрите также¶
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$194 per month—let's make that $500!
Learn more










