From 8d11e127ff15fbf133c33f97c994bcbc6400803c Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 5 Jul 2017 09:35:59 -0700 Subject: [PATCH] Fix several pieces of UI language describing "draft/archive" rules in Phame Summary: Ref T12900. We implement one rule, but tell users a different (older) rule. See T12900 for discussion and history. Test Plan: - Verified draft/archived posts can't be seen by users who don't have permission to edit the blog. - Drafted, archived, and published posts and read the related text. - Looked through the changes I dug up in T12900#228748 for other strings I might have missed. {F5033860} Reviewers: chad Reviewed By: chad Maniphest Tasks: T12900 Differential Revision: https://secure.phabricator.com/D18182 --- .../controller/post/PhamePostArchiveController.php | 5 +++-- .../controller/post/PhamePostViewController.php | 12 ++++++++---- src/applications/phame/storage/PhamePost.php | 5 +++-- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/applications/phame/controller/post/PhamePostArchiveController.php b/src/applications/phame/controller/post/PhamePostArchiveController.php index b8647121ef..093e7019bf 100644 --- a/src/applications/phame/controller/post/PhamePostArchiveController.php +++ b/src/applications/phame/controller/post/PhamePostArchiveController.php @@ -42,8 +42,9 @@ final class PhamePostArchiveController extends PhamePostController { $title = pht('Archive Post'); $body = pht( - 'This post will revert to archived status and no longer be visible '. - 'to other users or members of this blog.'); + 'If you archive this post, it will only be visible to users who can '. + 'edit %s.', + $viewer->renderHandle($post->getBlogPHID())); $button = pht('Archive Post'); return $this->newDialog() diff --git a/src/applications/phame/controller/post/PhamePostViewController.php b/src/applications/phame/controller/post/PhamePostViewController.php index a73876a197..63adedb7ae 100644 --- a/src/applications/phame/controller/post/PhamePostViewController.php +++ b/src/applications/phame/controller/post/PhamePostViewController.php @@ -46,8 +46,10 @@ final class PhamePostViewController ->setSeverity(PHUIInfoView::SEVERITY_NOTICE) ->setTitle(pht('Draft Post')) ->appendChild( - pht('Only you can see this draft until you publish it. '. - 'Use "Publish" to publish this post.'))); + pht( + 'This is a draft, and is only visible to you and other users '. + 'who can edit %s. Use "Publish" to publish this post.', + $viewer->renderHandle($post->getBlogPHID())))); } if ($post->isArchived()) { @@ -56,8 +58,10 @@ final class PhamePostViewController ->setSeverity(PHUIInfoView::SEVERITY_ERROR) ->setTitle(pht('Archived Post')) ->appendChild( - pht('Only you can see this archived post until you publish it. '. - 'Use "Publish" to publish this post.'))); + pht( + 'This post has been archived, and is only visible to you and '. + 'other users who can edit %s.', + $viewer->renderHandle($post->getBlogPHID())))); } if (!$post->getBlog()) { diff --git a/src/applications/phame/storage/PhamePost.php b/src/applications/phame/storage/PhamePost.php index f87a37e7a4..a9525e0be7 100644 --- a/src/applications/phame/storage/PhamePost.php +++ b/src/applications/phame/storage/PhamePost.php @@ -200,8 +200,9 @@ final class PhamePost extends PhameDAO } public function getPolicy($capability) { - // Draft posts are visible only to the author. Published posts are visible - // to whoever the blog is visible to. + // Draft and archived posts are visible only to the author and other + // users who can edit the blog. Published posts are visible to whoever + // the blog is visible to. switch ($capability) { case PhabricatorPolicyCapability::CAN_VIEW: -- 2.51.2