function flag_user::type_access_multiple in Flag 7.3
Same name and namespace in other branches
- 6.2 flag.inc \flag_user::type_access_multiple()
- 7.2 flag.inc \flag_user::type_access_multiple()
Implements access_multiple() implemented by each child class.
@abstract
Return value
An array keyed by entity ids, whose values represent the access to the corresponding entity. The access value may be FALSE if access should be denied, or NULL (or not set) if there is no restriction to be made. It should NOT be TRUE.
Overrides flag_flag::type_access_multiple
File
- includes/
flag/ flag_user.inc, line 62 - Contains the flag_user class.
Class
- flag_user
- Implements a user flag.
Code
function type_access_multiple($entity_ids, $account) {
$access = array();
// Exclude anonymous.
if (array_key_exists(0, $entity_ids)) {
$access[0] = FALSE;
}
// Prevent users from flagging themselves.
if ($this->access_uid == 'others' && array_key_exists($account->uid, $entity_ids)) {
$access[$account->uid] = FALSE;
}
return $access;
}