Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F17904968
D14437.id34883.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D14437.id34883.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D14437: Allow any Phame Blog member to see and edit drafts
Attached
Detach File
Event Timeline
Log In to Comment