1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-26 16:52:41 +01:00
phorge-phorge/resources/sql/autopatches/20151219.proj.06.defaultpolicy.php

29 lines
758 B
PHP
Raw Normal View History

<?php
$app = PhabricatorApplication::getByClass('PhabricatorProjectApplication');
$view_policy = $app->getPolicy(ProjectDefaultViewCapability::CAPABILITY);
$edit_policy = $app->getPolicy(ProjectDefaultEditCapability::CAPABILITY);
$join_policy = $app->getPolicy(ProjectDefaultJoinCapability::CAPABILITY);
$table = new PhabricatorProject();
$conn_w = $table->establishConnection('w');
queryfx(
$conn_w,
'UPDATE %T SET viewPolicy = %s WHERE viewPolicy IS NULL',
$table->getTableName(),
$view_policy);
queryfx(
$conn_w,
'UPDATE %T SET editPolicy = %s WHERE editPolicy IS NULL',
$table->getTableName(),
$edit_policy);
queryfx(
$conn_w,
'UPDATE %T SET joinPolicy = %s WHERE joinPolicy IS NULL',
$table->getTableName(),
$join_policy);