summaryrefslogtreecommitdiff
path: root/core/helpers
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2008-12-13 19:49:33 +0000
committerBharat Mediratta <bharat@menalto.com>2008-12-13 19:49:33 +0000
commit8ba5ea3cf832f42e93e98c3b984962ace3abf2d1 (patch)
treead44d2124cb4ae3f898cc4df2e6f45751805ac8d /core/helpers
parent65e237a59a99d7c5e8c32cdc7c730414f6dea30f (diff)
Make sure that access::can fails if the item is not loaded
Diffstat (limited to 'core/helpers')
-rw-r--r--core/helpers/access.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/helpers/access.php b/core/helpers/access.php
index f3880b89..3fb7548d 100644
--- a/core/helpers/access.php
+++ b/core/helpers/access.php
@@ -99,6 +99,10 @@ class access_Core {
* @return boolean
*/
public static function can($perm_name, $item) {
+ if (!$item->loaded) {
+ return false;
+ }
+
if ($perm_name == "view") {
$resource = $item;
} else {