Make it possible to create new tasks with Blender's policies

This commit is contained in:
2016-07-07 12:17:07 +02:00
parent 5bdc3dfad8
commit 2210be45fe

View File

@@ -453,6 +453,17 @@ final class ManiphestTransactionEditor
}
if ($app_capability) {
// Special exception for Blender:
// We don't want users to modify someone's else task policy and we don't
// really want user himself to modifu policy. Additionally, we can't grant
// policy modification to just task author which makes it's tricky to create
// new objects.
// So we ignore edit policy for new objects.
if ($app_capability == ManiphestEditPoliciesCapability::CAPABILITY) {
if ($object->getPHID() == "") {
return;
}
}
$app = id(new PhabricatorApplicationQuery())
->setViewer($this->getActor())
->withClasses(array('PhabricatorManiphestApplication'))