diff options
author | Brion Vibber <brion@pobox.com> | 2009-11-25 22:10:55 +0000 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2009-11-25 22:23:21 +0000 |
commit | b771a8bb2124d4e48df2e3d3d3078c4de1da3483 (patch) | |
tree | 5b0c0a15154d79593f4a67c88617b3949153b9bc /classes/Remote_profile.php | |
parent | f1b64c4db52d6881c845704bfde3e3514e3ebe8f (diff) |
Fix regression in remote subscription; added hasRole() shadow method on Remote_profile.
DB_DataObject hides errors by silently returning null for any non-existent method call, making it harder to tell what the heck's going on... the rights check for blocked remote users returned null for the check for subscribe rights, thus eval'ing to false. We now log a note in this circumstance, which would have cut about 3 hours off of the debug time.
Diffstat (limited to 'classes/Remote_profile.php')
-rw-r--r-- | classes/Remote_profile.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/classes/Remote_profile.php b/classes/Remote_profile.php index 9f7bfeadc..0a1676a6a 100644 --- a/classes/Remote_profile.php +++ b/classes/Remote_profile.php @@ -43,4 +43,14 @@ class Remote_profile extends Memcached_DataObject /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE + + function hasRight($right) + { + $profile = Profile::staticGet($this->id); + if ($profile) { + return $profile->hasright($right); + } else { + throw new Exception("Missing profile"); + } + } } |