]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #1164: can_write_to_container() now sends default values through container_perm...
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sun, 31 Jan 2010 22:16:05 +0000 (22:16 +0000)
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sun, 31 Jan 2010 22:16:05 +0000 (22:16 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@3871 36083f99-b078-4883-b0ff-0f9b5a30f544

CHANGES.txt
engine/lib/entities.php

index d88332adf8d0aae408b86469d2968c85e616d22c..a224c21cf1520e34610e90bfda350fbcd1d039b4 100644 (file)
@@ -35,6 +35,7 @@ http://code.elgg.org/elgg/.....
   * unregister_elgg_event_handler() and unregister_plugin_hook() added. #1465
   * clear_all_plugin_settings() added.
   * get_entity_relationships() supports inverse relationships. #1472.
+  * can_write_to_container() can be overridden with the container_permissions_check hook. #1164 (part 2).
 
  Services API:
   * Separated user and api authenticate processing
index fe6017e1be3b0c8c917d24613405376066ee4ba8..59dc656588c0b03b93d5bcc083eaeb948b6343e1 100644 (file)
@@ -1471,7 +1471,7 @@ function can_write_to_container($user_guid = 0, $container_guid = 0, $entity_typ
                $container_guid = page_owner();
        }
        if (!$container_guid) {
-               return true;
+               $return = TRUE;
        }
 
        $container = get_entity($container_guid);
@@ -1479,21 +1479,21 @@ function can_write_to_container($user_guid = 0, $container_guid = 0, $entity_typ
        if ($container) {
                // If the user can edit the container, they can also write to it
                if ($container->canEdit($user_guid)) {
-                       return true;
+                       $return = TRUE;
                }
 
                // Basics, see if the user is a member of the group.
                if ($user && $container instanceof ElggGroup) {
                        if (!$container->isMember($user)) {
-                               return false;
+                               $return = FALSE;
                        } else {
-                               return true;
+                               $return = TRUE;
                        }
                }
 
                // See if anyone else has anything to say
                return trigger_plugin_hook('container_permissions_check', $entity_type,
-                       array('container' => $container, 'user' => $user), false);
+                       array('container' => $container, 'user' => $user), $return);
        }
 
        return false;