Changeset View
Changeset View
Standalone View
Standalone View
src/applications/maniphest/storage/ManiphestTask.php
| Context not available. | |||||
| public function hasAutomaticCapability($capability, PhabricatorUser $user) { | public function hasAutomaticCapability($capability, PhabricatorUser $user) { | ||||
| $user_phid = $user->getPHID(); | |||||
| // The owner of a task can always view and edit it. | // The owner of a task can always view and edit it. | ||||
| $owner_phid = $this->getOwnerPHID(); | $owner_phid = $this->getOwnerPHID(); | ||||
| if ($owner_phid) { | if ($owner_phid) { | ||||
| $user_phid = $user->getPHID(); | |||||
| if ($user_phid == $owner_phid) { | if ($user_phid == $owner_phid) { | ||||
| return true; | return true; | ||||
| } | } | ||||
| } | } | ||||
| // The author of a task can always view and edit it. | |||||
| $author_phid = $this->getAuthorPHID(); | |||||
| if ($author_phid) { | |||||
| if ($user_phid == $author_phid) { | |||||
| return true; | |||||
| } | |||||
| } | |||||
| return false; | return false; | ||||
| } | } | ||||
| public function describeAutomaticCapability($capability) { | public function describeAutomaticCapability($capability) { | ||||
| return pht( | return pht( | ||||
| 'The owner of a task can always view and edit it.'); | 'The author/owner of a task can always view and edit it.'); | ||||
| } | } | ||||
| Context not available. | |||||