diff options
author | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-08-13 22:27:01 +0000 |
---|---|---|
committer | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-08-13 22:27:01 +0000 |
commit | 96d830c50c7650229b4fad2bdcb3e863ec0bdc2a (patch) | |
tree | a07a441cdaeb8a2f1e613fd631fd7d096b42c519 /engine/lib/entities.php | |
parent | 2d508007f90be53f1895f284844ba1e1d52ac14c (diff) | |
download | elgg-96d830c50c7650229b4fad2bdcb3e863ec0bdc2a.tar.gz elgg-96d830c50c7650229b4fad2bdcb3e863ec0bdc2a.tar.bz2 |
Closes #227 and #243: Hopefully this has the fscking thing nailed to the wall.
Please report any problems, especially is they relate to access permissions (granted when you shouldn't or denied when you should)
git-svn-id: https://code.elgg.org/elgg/trunk@1912 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/entities.php')
-rw-r--r-- | engine/lib/entities.php | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/engine/lib/entities.php b/engine/lib/entities.php index 5a794024b..427dd5c7d 100644 --- a/engine/lib/entities.php +++ b/engine/lib/entities.php @@ -86,7 +86,7 @@ $this->attributes['access_id'] = 0; $this->attributes['time_created'] = ""; $this->attributes['time_updated'] = ""; - $this->attributes['enabled'] = ""; + $this->attributes['enabled'] = "yes"; // There now follows a bit of a hack /* Problem: To speed things up, some objects are split over several tables, this means that it requires @@ -1163,24 +1163,23 @@ function can_write_to_container($user_guid = 0, $container_guid = 0, $entity_type = 'all')
{
global $CONFIG;
-
+
$user_guid = (int)$user_guid;
if (!$user_guid) $user_guid = (int) $_SESSION['guid'];
$user = get_entity($user_guid);
$container_guid = (int)$container_guid;
if (!$container_guid) $container_guid = page_owner();
-
if (!$container_guid) return true;
-
+
$container = get_entity($container_guid);
-
+
if (($container) && ($user))
{
-
+
// If the user can edit the container, they can also write to it
if ($container->canEdit()) return true;
-
+
// Basics, see if the user is a member of the group.
if ($container instanceof ElggGroup) {
if (!$container->isMember($user)) {
@@ -1189,7 +1188,7 @@ 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);
|