Page MenuHomePhabricator

D14437.id34883.diff
No OneTemporary

D14437.id34883.diff

diff --git a/src/applications/phame/controller/post/PhamePostViewController.php b/src/applications/phame/controller/post/PhamePostViewController.php
--- a/src/applications/phame/controller/post/PhamePostViewController.php
+++ b/src/applications/phame/controller/post/PhamePostViewController.php
@@ -44,12 +44,12 @@
if ($post->isDraft()) {
$document->appendChild(
id(new PHUIInfoView())
- ->setSeverity(PHUIInfoView::SEVERITY_NOTICE)
+ ->setSeverity(PHUIInfoView::SEVERITY_WARNING)
->setTitle(pht('Draft Post'))
->appendChild(
pht(
- 'Only you can see this draft until you publish it. '.
- 'Use "Preview / Publish" to publish this post.')));
+ 'Only members of this blog can see this draft until it is '.
+ 'published. Use "Preview / Publish" to publish this post.')));
}
if (!$post->getBlog()) {
diff --git a/src/applications/phame/storage/PhamePost.php b/src/applications/phame/storage/PhamePost.php
--- a/src/applications/phame/storage/PhamePost.php
+++ b/src/applications/phame/storage/PhamePost.php
@@ -191,19 +191,26 @@
}
public function getPolicy($capability) {
- // Draft posts are visible only to the author. Published posts are visible
- // to whoever the blog is visible to.
+ // Draft posts are visible only members of the Blog's Join Policy
+ // Live posts are visible to the Blog's View Policy
switch ($capability) {
case PhabricatorPolicyCapability::CAN_VIEW:
if (!$this->isDraft() && $this->getBlog()) {
return $this->getBlog()->getViewPolicy();
+ } else if ($this->getBlog()) {
+ return $this->getBlog()->getJoinPolicy();
} else {
return PhabricatorPolicies::POLICY_NOONE;
}
break;
case PhabricatorPolicyCapability::CAN_EDIT:
- return PhabricatorPolicies::POLICY_NOONE;
+ if ($this->getBlog()) {
+ return $this->getBlog()->getJoinPolicy();
+ } else {
+ return PhabricatorPolicies::POLICY_NOONE;
+ }
+ break;
}
}

File Metadata

Mime Type
text/plain
Expires
Wed, Jul 30, 11:45 AM (1 d, 14 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
8738181
Default Alt Text
D14437.id34883.diff (2 KB)

Event Timeline