53 return elgg()->session->setIgnoreAccess($ignore);
64 return elgg()->session->getIgnoreAccess();
135 $user_access =
$user->getPrivateSetting(
'elgg_default_access');
136 if ($user_access !== null) {
157 elgg()->session->setDisabledEntityVisibility($show_hidden);
166 return elgg()->session->getDisabledEntityVisibility();
280 return _elgg_services()->accessCollections->update($collection_id, $members);
293 return _elgg_services()->accessCollections->delete($collection_id);
376 foreach (
$rows as $row) {
377 $guids[] = (int) $row->guid;
398 return _elgg_services()->accessCollections->getReadableAccessLevel($entity_access_id);
426 $user = $event->getObject();
448 $relationship_object = $event->getObject();
453 if ($relationship_object->relationship !==
'friend') {
458 $friend =
get_user($relationship_object->guid_two);
460 if (!
$user || !$friend) {
464 $acl =
$user->getOwnedAccessCollection(
'friends');
468 $acl->addMember($friend->guid);
485 $relationship_object = $event->getObject();
490 if ($relationship_object->relationship !==
'friend') {
495 $friend =
get_user($relationship_object->guid_two);
497 if (!
$user || !$friend) {
501 $acl =
$user->getOwnedAccessCollection(
'friends');
506 $acl->removeMember($friend->guid);
523 $access_collection = $hook->getParam(
'access_collection');
528 if ($access_collection->getSubtype() !==
'friends') {
532 return elgg_echo(
'access:label:friends');
559 $events->registerHandler(
'ready',
'system',
'access_init');
562 $events->registerHandler(
'create',
'user',
'access_friends_acl_create');
563 $events->registerHandler(
'create',
'relationship',
'access_friends_acl_add_friend');
564 $events->registerHandler(
'delete',
'relationship',
'access_friends_acl_remove_friend');
565 $hooks->registerHandler(
'access_collection:name',
'access_collection',
'access_friends_acl_get_name');
567 $hooks->registerHandler(
'unit_test',
'system',
'access_test');
if(!$user||!$user->canDelete()) $name
get_access_list($user_guid=0, $ignored=0, $flush=false)
Return a string of access_ids for $user_guid appropriate for inserting into an SQL IN clause...
get_user($guid)
Get a user object from a GUID.
delete_access_collection($collection_id)
Deletes a specified access collection and its membership.
access_init()
A quick and dirty way to make sure the access permissions have been correctly set up...
access_friends_acl_get_name(\Elgg\Hook $hook)
Return the name of a friends ACL.
get_write_access_array($user_guid=0, $ignored=0, $flush=false, array $input_params=[])
Returns an array of access permissions that the user is allowed to save content with.
get_access_collection($collection_id)
Get a specified access collection.
update_access_collection($collection_id, $members)
Updates the membership in an access collection.
elgg_get_access_collections($options=[])
Returns access collections.
elgg_echo($message_key, array $args=[], $language="")
Given a message key, returns an appropriately translated full-text string.
access_test($hook, $type, $value, $params)
Runs unit tests for the access library.
remove_user_from_access_collection($user_guid, $collection_id)
Removes a user from an access collection.
elgg_get_ignore_access()
Get current ignore access setting.
$user_guid
Validate a user.
Base class for events and hooks.
global $ENTITY_SHOW_HIDDEN_OVERRIDE
Allow disabled entities and metadata to be returned by getter functions.
elgg_set_ignore_access($ignore=true)
Set if Elgg's access system should be ignored.
add_user_to_access_collection($user_guid, $collection_id)
Adds a user to an access collection.
elgg global
Pointer to the global context.
$CONFIG allow_user_default_access
Are users allow to enter their own default access levels.
create_access_collection($name, $owner_guid=0, $subtype=null)
Creates a new access collection.
get_readable_access_level($entity_access_id)
Return the name of an ACCESS_* constant or an access collection, but only if the logged in user has w...
access_get_show_hidden_status()
Return current status of showing disabled entities.
access_friends_acl_remove_friend(\Elgg\Event $event)
Add the friend to the user friends ACL.
$guids
Activates all specified installed and inactive plugins.
_elgg_config()
Get the Elgg config service.
access_show_hidden_entities($show_hidden)
Show or hide disabled entities.
get_access_array($user_guid=0, $ignored=0, $flush=false)
Returns an array of access IDs a user is permitted to see.
has_access_to_entity($entity, $user=null)
Can a user access an entity.
get_members_of_access_collection($collection_id, $guids_only=false, array $options=[])
Get all of members of an access collection.
_elgg_services()
Get the global service provider.
can_edit_access_collection($collection_id, $user_guid=null)
Can the user change this access collection?
access_friends_acl_add_friend(\Elgg\Event $event)
Adds the friend to the user friend ACL.
get_default_access(ElggUser $user=null, array $input_params=[])
Gets the default access permission.
access_friends_acl_create(\Elgg\Event $event)
Creates a Friends ACL for a user.
if(!$user instanceof ElggUser) $default_access