Познай дзен Друпала — помоги переводчикам! Можешь начать с регистрации.
modules/node/node.module, строка 2131
- 5
node_access_grants($op, $uid = NULL)
- 6
node_access_grants($op, $account = NULL)
Fetch an array of permission IDs granted to the given user ID.
The implementation here provides only the universal 'all'
grant. A node
access module should implement hook_node_grants()
to provide a grant
list for the user.
Параметры
$op
The operation that the user is trying to perform.
$account
The user object for the user performing the operation. If omitted, the
current user is used.
Возвращаемое значение
An associative array in which the keys are realms, and the values are
arrays of grants for those realms.
Fetch an array of permission IDs granted to the given user ID.
The implementation here provides only the universal "all" grant. A node
access module should implement hook_node_grants() to provide a grant
list for the user.
Parameters
$op
The operation that the user is trying to perform.
$account
The user object for the user performing the operation. If omitted, the
current user is used.
Return value
An associative array in which the keys are realms, and the values are
arrays of grants for those realms.
Связанные темы
- Система доступа к нодам
- Система доступа к нодам определяет кто и что может сделать с определёнными нодами.
▸ 3 функции вызывают node_access_grants()
▾ 3 функции вызывают node_access_grants()
- node_access in modules/node/node.module
- Устанавливает, может ли текущий пользователь выполнять заданные действия над определённой нодой.
- node_access_view_all_nodes in modules/node/node.module
- Determine whether the user has a global viewing grant for all nodes.
- _node_access_where_sql in modules/node/node.module
- Generate an SQL where clause for use in fetching a node listing.
Код
<?php
function node_access_grants($op, $account = NULL) {
if (!isset($account)) {
$account = $GLOBALS['user'];
}
return array_merge(array('all' => array(0)), module_invoke_all('node_grants', $account, $op));
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии