From 82b38b62a4bc40d0782cd0be3ee57cf00e77dd36 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sat, 26 Mar 2011 16:23:20 -0400 Subject: [PATCH] clearer scope rules for anonymous and author --- classes/Notice.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/classes/Notice.php b/classes/Notice.php index b380f027a2..f6d0a689cb 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -2043,10 +2043,21 @@ class Notice extends Memcached_DataObject function inScope($profile) { - // If there's any scope, and there's no logged-in user, - // not allowed. + // If there's no scope, anyone (even anon) is in scope. - if ($this->scope > 0 && empty($profile)) { + if ($this->scope == 0) { + return true; + } + + // If there's scope, anon cannot be in scope + + if (empty($profile)) { + return false; + } + + // Author is always in scope + + if ($this->profile_id == $profile->id) { return false; } -- 2.39.5