]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #4329 removed old recursive delete permissions override
authorCash Costello <cash.costello@gmail.com>
Sat, 28 Jan 2012 12:56:09 +0000 (07:56 -0500)
committerCash Costello <cash.costello@gmail.com>
Sat, 28 Jan 2012 12:56:09 +0000 (07:56 -0500)
engine/lib/entities.php

index 0b229aac55161222fcefd36ba5358fade0ddead8..4875b2c2f730a4649bcaa79cf595551f2738e08b 100644 (file)
@@ -2178,29 +2178,6 @@ function elgg_list_registered_entities(array $options = array()) {
        return elgg_view_entity_list($entities, $options);
 }
 
-/**
- * Check the recursive delete permissions token.
- *
- * If an entity is deleted recursively, a permissions override is required to allow
- * contained or owned entities to be removed.
- *
- * @return bool
- * @elgg_plugin_hook_handler permissions_check all
- * @elgg_plugin_hook_handler permissions_check:metadata all
- * @access private
- */
-function recursive_delete_permissions_check() {
-       static $__RECURSIVE_DELETE_TOKEN;
-
-       if ((elgg_is_logged_in()) && ($__RECURSIVE_DELETE_TOKEN)
-       && (strcmp($__RECURSIVE_DELETE_TOKEN, md5(elgg_get_logged_in_user_guid())))) {
-               return true;
-       }
-
-       // consult next function
-       return NULL;
-}
-
 /**
  * Checks if $entity is an ElggEntity and optionally for type and subtype.
  *
@@ -2315,11 +2292,6 @@ function entities_init() {
 
        elgg_register_plugin_hook_handler('unit_test', 'system', 'entities_test');
 
-       // Allow a permission override for recursive entity deletion
-       // @todo Can this be done better?
-       elgg_register_plugin_hook_handler('permissions_check', 'all', 'recursive_delete_permissions_check');
-       elgg_register_plugin_hook_handler('permissions_check:metadata', 'all', 'recursive_delete_permissions_check');
-
        elgg_register_plugin_hook_handler('gc', 'system', 'entities_gc');
 }