Go to the source code of this file.
Namespaces | |
| namespace | Elgg::Core |
Activate a plugin or plugins. | |
Functions | |
| get_access_list ($user_id=0, $site_id=0, $flush=false) | |
| Return a string of access_ids for $user_id appropriate for inserting into an SQL IN clause. | |
| get_access_array ($user_id=0, $site_id=0, $flush=false) | |
| Returns an array of access IDs a user is permitted to see. | |
| get_default_access (ElggUser $user=null) | |
| Gets the default access permission. | |
| access_show_hidden_entities ($show_hidden) | |
| Show or hide disabled entities. | |
| access_get_show_hidden_status () | |
| Return current status of showing disabled entities. | |
| get_access_sql_suffix ($table_prefix= '', $owner=null) | |
| Returns the SQL where clause for a table with a access_id and enabled columns. | |
| get_access_restriction_sql ($annotation_name, $entity_guid, $owner_guid, $exists) | |
| Get the where clause for an access restriction based on annotations. | |
| has_access_to_entity ($entity, $user=null) | |
| Can a user access an entity. | |
| get_write_access_array ($user_id=0, $site_id=0, $flush=false) | |
| Returns an array of access permissions that the user is allowed to save content with. | |
| can_edit_access_collection ($collection_id, $user_guid=null) | |
| Can the user change this access collection? | |
| create_access_collection ($name, $owner_guid=0, $site_guid=0) | |
| Creates a new access collection. | |
| update_access_collection ($collection_id, $members) | |
| Updates the membership in an access collection. | |
| delete_access_collection ($collection_id) | |
| Deletes a specified access collection and its membership. | |
| get_access_collection ($collection_id) | |
| Get a specified access collection. | |
| add_user_to_access_collection ($user_guid, $collection_id) | |
| Adds a user to an access collection. | |
| remove_user_from_access_collection ($user_guid, $collection_id) | |
| Removes a user from an access collection. | |
| get_user_access_collections ($owner_guid, $site_guid=0) | |
| Returns an array of database row objects of the access collections owned by $owner_guid. | |
| get_members_of_access_collection ($collection, $idonly=FALSE) | |
| Get all of members of an access collection. | |
| elgg_get_entities_from_access_id (array $options=array()) | |
| Return entities based upon access id. | |
| elgg_list_entities_from_access_id (array $options=array()) | |
| Lists entities from an access collection. | |
| get_readable_access_level ($entity_access_id) | |
| Return the name of an ACCESS_* constant or a access collection, but only if the user has write access on that ACL. | |
| elgg_set_ignore_access ($ignore=true) | |
| Set if entity access system should be ignored. | |
| elgg_get_ignore_access () | |
| Get current ignore access setting. | |
| elgg_check_access_overrides ($user_guid=0) | |
| Decides if the access system should be ignored for a user. | |
| elgg_get_access_object () | |
| Returns the ElggAccess object. | |
| access_init () | |
| A quick and dirty way to make sure the access permissions have been correctly set up. | |
| elgg_override_permissions ($hook, $type, $value, $params) | |
| Overrides the access system if appropriate. | |
| access_test ($hook, $type, $value, $params) | |
| Runs unit tests for the entities object. | |
Variables | |
| $ENTITY_SHOW_HIDDEN_OVERRIDE = false | |
| Allow disabled entities and metadata to be returned by getter functions. | |
| $init_finished = false | |
| A flag to set if Elgg's access initialization is finished. | |
| access_get_show_hidden_status | ( | ) |
Return current status of showing disabled entities.
Definition at line 209 of file access.php.
| access_init | ( | ) |
A quick and dirty way to make sure the access permissions have been correctly set up.
init system
Definition at line 961 of file access.php.
| access_show_hidden_entities | ( | $ | show_hidden | ) |
Show or hide disabled entities.
| bool | $show_hidden Show disabled entities. |
Definition at line 198 of file access.php.
| access_test | ( | $ | hook, | |
| $ | type, | |||
| $ | value, | |||
| $ | params | |||
| ) |
| add_user_to_access_collection | ( | $ | user_guid, | |
| $ | collection_id | |||
| ) |
Adds a user to an access collection.
Triggers the 'access:collections:add_user', 'collection' plugin hook.
| int | $user_guid The GUID of the user to add | |
| int | $collection_id The ID of the collection to add them to |
Definition at line 651 of file access.php.
| can_edit_access_collection | ( | $ | collection_id, | |
| $ | user_guid = null | |||
| ) |
Can the user change this access collection?
Use the plugin hook of 'access:collections:write', 'user' to change this.
Respects access control disabling for admin users and {
| int | $collection_id The collection id | |
| mixed | $user_guid The user GUID to check for. Defaults to logged in user. |
Definition at line 459 of file access.php.
| create_access_collection | ( | $ | name, | |
| $ | owner_guid = 0, |
|||
| $ | site_guid = 0 | |||
| ) |
Creates a new access collection.
Access colletions allow plugins and users to create granular access for entities.
Triggers plugin hook 'access:collections:addcollection', 'collection'
Definition at line 502 of file access.php.
| delete_access_collection | ( | $ | collection_id | ) |
Deletes a specified access collection and its membership.
| int | $collection_id The collection ID |
Definition at line 594 of file access.php.
| elgg_check_access_overrides | ( | $ | user_guid = 0 |
) |
Decides if the access system should be ignored for a user.
Returns true (meaning ignore access) if either of these 2 conditions are true: 1) an admin user guid is passed to this function. 2) elgg_get_ignore_access() returns true.
| int | $user_guid The user to check against. |
Definition at line 914 of file access.php.
| elgg_get_access_object | ( | ) |
Returns the ElggAccess object.
//
Definition at line 934 of file access.php.
| elgg_get_entities_from_access_id | ( | array $ | options = array() |
) |
Return entities based upon access id.
| array | $options Any options accepted by elgg_get_entities() and access_id => int The access ID of the entity. |
Definition at line 799 of file access.php.
| elgg_get_ignore_access | ( | ) |
Get current ignore access setting.
Definition at line 896 of file access.php.
| elgg_list_entities_from_access_id | ( | array $ | options = array() |
) |
Lists entities from an access collection.
| array | $options See elgg_list_entities() and elgg_get_entities_from_access_id() |
Definition at line 831 of file access.php.
| elgg_override_permissions | ( | $ | hook, | |
| $ | type, | |||
| $ | value, | |||
| $ | params | |||
| ) |
Overrides the access system if appropriate.
Allows admin users and calls after elgg_set_ignore_access to bypass the access system.
Registered for the 'permissions_check', 'all' and the 'container_permissions_check', 'all' plugin hooks.
Returns true to override the access system or null if no change is needed.
Definition at line 980 of file access.php.
| elgg_set_ignore_access | ( | $ | ignore = true |
) |
Set if entity access system should be ignored.
The access system will not return entities in any getter functions if the user doesn't have access.
Definition at line 883 of file access.php.
| get_access_array | ( | $ | user_id = 0, |
|
| $ | site_id = 0, |
|||
| $ | flush = false | |||
| ) |
Returns an array of access IDs a user is permitted to see.
Can be overridden with the 'access:collections:read', 'user' plugin hook.
This returns a list of all the collection ids a user owns or belongs to plus public and logged in access levels. If the user is an admin, it includes the private access level.
Definition at line 79 of file access.php.
| get_access_collection | ( | $ | collection_id | ) |
Get a specified access collection.
| int | $collection_id The collection ID |
Definition at line 628 of file access.php.
| get_access_list | ( | $ | user_id = 0, |
|
| $ | site_id = 0, |
|||
| $ | flush = false | |||
| ) |
Return a string of access_ids for $user_id appropriate for inserting into an SQL IN clause.
get_access_array
Definition at line 30 of file access.php.
| get_access_restriction_sql | ( | $ | annotation_name, | |
| $ | entity_guid, | |||
| $ | owner_guid, | |||
| $ | exists | |||
| ) |
Get the where clause for an access restriction based on annotations.
Returns an SQL fragment that is true (or optionally false) if the given user has added an annotation with the given name to the given entity.
| string | $annotation_name Name of the annotation | |
| string | $entity_guid SQL GUID of entity the annotation is attached to. | |
| string | $owner_guid SQL string that evaluates to the GUID of the annotation owner | |
| boolean | $exists If true, returns BOOL if the annotation exists |
Definition at line 312 of file access.php.
| get_access_sql_suffix | ( | $ | table_prefix = '', |
|
| $ | owner = null | |||
| ) |
Returns the SQL where clause for a table with a access_id and enabled columns.
This handles returning where clauses for ACCESS_FRIENDS and the currently unused block and filter lists in addition to using get_access_list() for access collections and the standard access levels.
| string | $table_prefix Optional table. prefix for the access code. | |
| int | $owner The guid to check access for. Defaults to logged in user. |
Definition at line 227 of file access.php.
| get_default_access | ( | ElggUser $ | user = null |
) |
Gets the default access permission.
This returns the default access level for the site or optionally for the user.
| ElggUser | $user Get the user's default access. Defaults to logged in user. |
Definition at line 164 of file access.php.
| get_members_of_access_collection | ( | $ | collection, | |
| $ | idonly = FALSE | |||
| ) |
Get all of members of an access collection.
| int | $collection The collection's ID | |
| bool | $idonly If set to true, will only return the members' GUIDs (default: false) |
Definition at line 764 of file access.php.
| get_readable_access_level | ( | $ | entity_access_id | ) |
Return the name of an ACCESS_* constant or a access collection, but only if the user has write access on that ACL.
| int | $entity_access_id The entity's access id |
Definition at line 848 of file access.php.
| get_user_access_collections | ( | $ | owner_guid, | |
| $ | site_guid = 0 | |||
| ) |
Returns an array of database row objects of the access collections owned by $owner_guid.
| int | $owner_guid The entity guid | |
| int | $site_guid The GUID of the site (default: current site). |
Definition at line 736 of file access.php.
| get_write_access_array | ( | $ | user_id = 0, |
|
| $ | site_id = 0, |
|||
| $ | flush = false | |||
| ) |
Returns an array of access permissions that the user is allowed to save content with.
Permissions returned are of the form (id => 'name').
Example return value in English: array( 0 => 'Private', -2 => 'Friends', 1 => 'Logged in users', 2 => 'Public', 34 => 'My favorite friends', );
Plugin hook of 'access:collections:write', 'user'
| int | $user_id The user's GUID. | |
| int | $site_id The current site. | |
| bool | $flush If this is set to true, this will ignore a cached access array |
Definition at line 396 of file access.php.
| has_access_to_entity | ( | $ | entity, | |
| $ | user = null | |||
| ) |
Can a user access an entity.
This is mostly useful for checking if a user other than the logged in user has access to an entity that is currently loaded.
| ElggEntity | $entity The entity to check access for. | |
| ElggUser | $user Optionally user to check access for. Defaults to logged in user (which is a useless default). |
Definition at line 351 of file access.php.
| remove_user_from_access_collection | ( | $ | user_guid, | |
| $ | collection_id | |||
| ) |
Removes a user from an access collection.
Triggers the 'access:collections:remove_user', 'collection' plugin hook.
| int | $user_guid The user GUID | |
| int | $collection_id The access collection ID |
Definition at line 696 of file access.php.
| update_access_collection | ( | $ | collection_id, | |
| $ | members | |||
| ) |
Updates the membership in an access collection.
| int | $collection_id The ID of the collection. | |
| array | $members Array of member GUIDs |
Definition at line 555 of file access.php.
| $ENTITY_SHOW_HIDDEN_OVERRIDE = false |
Allow disabled entities and metadata to be returned by getter functions.
Definition at line 189 of file access.php.
| $init_finished = false |
A flag to set if Elgg's access initialization is finished.
bool $init_finished private
Definition at line 951 of file access.php.
1.6.3