From cd449254256db7fee74821e7735f7d8b8b09fffa Mon Sep 17 00:00:00 2001 From: Arturas Moskvinas Date: Mon, 22 Jul 2019 13:03:16 +0300 Subject: [PATCH] Allow users with no CAN_EDIT permissions to silence projects if they want to Summary: Humble user cannot silence/mute project if he/she has no CAN_EDIT permissions in it. You can actually leave it but if project is locked - then you're scr*wed. Test Plan: 1. On a testing phabricator instance created a dummy project 2. Changed that project permissions CAN_EDIT to be by admin only 3. Added poor soul with no CAN_EDIT permissions 4. Logged it in with poor soul 5. Tried to silence the project 6. The Project is successfully silenced 7. User is happy :) Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: Korvin, Pawka Differential Revision: https://secure.phabricator.com/D20675 --- .../editor/PhabricatorApplicationTransactionEditor.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php index da5e4d3634..01294e308a 100644 --- a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php +++ b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php @@ -1801,6 +1801,11 @@ abstract class PhabricatorApplicationTransactionEditor // you don't need permissions. If you can eventually mute an object // for other users, this would need to be revisited. return null; + case PhabricatorProjectSilencedEdgeType::EDGECONST: + // At time of writing, you can only write this edge for yourself, so + // you don't need permissions. If you can eventually silence project + // for other users, this would need to be revisited. + return null; case PhabricatorObjectMentionsObjectEdgeType::EDGECONST: return null; case PhabricatorProjectProjectHasMemberEdgeType::EDGECONST: