2014-01-09 21:19:45 +01:00
|
|
|
<?php
|
|
|
|
|
2014-07-25 00:20:39 +02:00
|
|
|
final class DrydockDefaultViewCapability extends PhabricatorPolicyCapability {
|
2014-01-09 21:19:45 +01:00
|
|
|
|
|
|
|
const CAPABILITY = 'drydock.default.view';
|
|
|
|
|
|
|
|
public function getCapabilityName() {
|
|
|
|
return pht('Default Blueprint View Policy');
|
|
|
|
}
|
|
|
|
|
Give Drydock resources a proper expiry mechanism
Summary:
Fixes T6569. This implements an expiry mechanism for Drydock resources which parallels the mechanism for leases.
A few things are missing that we'll probably need in the future:
- An "EXPIRES" command to update the expiration time. This would let resources be permanent while leased, then expire after, say, 24 hours without any leases.
- A callback like `shouldActuallyExpireRightNow()` for resources and leases that lets them decide not to expire at the last second.
- A callback like `didAcquireLease()` for resource blueprints, to parallel `didReleaseLease()`, letting them clear or extend their timer.
However, this stuff would mostly just let us tune behaviors, not really open up new capabilities.
Test Plan: Changed host resources to expire after 60 seconds, leased one, saw it vanish 60 seconds later.
Reviewers: hach-que, chad
Reviewed By: chad
Maniphest Tasks: T6569
Differential Revision: https://secure.phabricator.com/D14176
2015-09-28 18:35:14 +02:00
|
|
|
public function shouldAllowPublicPolicySetting() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2014-01-09 21:19:45 +01:00
|
|
|
}
|