Handle private streams better (failed to show profile before)

This commit is contained in:
Mikael Nordfeldth
2016-01-03 19:05:49 +01:00
parent 7df8a6b731
commit df0f9547b5
4 changed files with 52 additions and 9 deletions

View File

@@ -761,6 +761,17 @@ class Profile extends Managed_DataObject
return Subscription::exists($this, $other);
}
function readableBy(Profile $other=null)
{
// If it's not a private stream, it's readable by anyone
if (!$this->isPrivateStream()) {
return true;
}
// If it's a private stream, $other must be a subscriber to $this
return is_null($other) ? false : $other->isSubscribed($this);
}
/**
* Check if a pending subscription request is outstanding for this...
*