1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 00:42:41 +01:00

Don't require "CAN_EDIT" to watch/unwatch a project

Summary:
See T1024. When "CAN_EDIT" became default in T13186, this was missed as an exception.

Watching shouldn't require "CAN_EDIT", so exempt it.

Test Plan:
  - Before change: tried to watch a project I could not edit, got a policy error.
  - After change: watched/unwatched a project I could not edit.

Reviewers: amckinley

Reviewed By: amckinley

Differential Revision: https://secure.phabricator.com/D19977
This commit is contained in:
epriestley 2019-01-16 05:51:59 -08:00
parent 64e3296fe6
commit 966a93334c

View file

@ -1677,6 +1677,9 @@ abstract class PhabricatorApplicationTransactionEditor
// You need CAN_EDIT to change members other than yourself.
return PhabricatorPolicyCapability::CAN_EDIT;
case PhabricatorObjectHasWatcherEdgeType::EDGECONST:
// See PHI1024. Watching a project does not require CAN_EDIT.
return null;
default:
return PhabricatorPolicyCapability::CAN_EDIT;
}