Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93544677
DrydockLog.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Nov 29, 15:00
Size
2 KB
Mime Type
text/x-php
Expires
Sun, Dec 1, 15:00 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22663086
Attached To
rPH Phabricator
DrydockLog.php
View Options
<?php
final
class
DrydockLog
extends
DrydockDAO
implements
PhabricatorPolicyInterface
{
protected
$resourceID
;
protected
$leaseID
;
protected
$epoch
;
protected
$message
;
private
$resource
=
self
::
ATTACHABLE
;
private
$lease
=
self
::
ATTACHABLE
;
protected
function
getConfiguration
()
{
return
array
(
self
::
CONFIG_TIMESTAMPS
=>
false
,
self
::
CONFIG_COLUMN_SCHEMA
=>
array
(
'resourceID'
=>
'id?'
,
'leaseID'
=>
'id?'
,
'message'
=>
'text'
,
),
self
::
CONFIG_KEY_SCHEMA
=>
array
(
'resourceID'
=>
array
(
'columns'
=>
array
(
'resourceID'
,
'epoch'
),
),
'leaseID'
=>
array
(
'columns'
=>
array
(
'leaseID'
,
'epoch'
),
),
'epoch'
=>
array
(
'columns'
=>
array
(
'epoch'
),
),
),
)
+
parent
::
getConfiguration
();
}
public
function
attachResource
(
DrydockResource
$resource
=
null
)
{
$this
->
resource
=
$resource
;
return
$this
;
}
public
function
getResource
()
{
return
$this
->
assertAttached
(
$this
->
resource
);
}
public
function
attachLease
(
DrydockLease
$lease
=
null
)
{
$this
->
lease
=
$lease
;
return
$this
;
}
public
function
getLease
()
{
return
$this
->
assertAttached
(
$this
->
lease
);
}
/* -( PhabricatorPolicyInterface )----------------------------------------- */
public
function
getCapabilities
()
{
return
array
(
PhabricatorPolicyCapability
::
CAN_VIEW
,
);
}
public
function
getPolicy
(
$capability
)
{
if
(
$this
->
getResource
())
{
return
$this
->
getResource
()->
getPolicy
(
$capability
);
}
return
$this
->
getLease
()->
getPolicy
(
$capability
);
}
public
function
hasAutomaticCapability
(
$capability
,
PhabricatorUser
$viewer
)
{
if
(
$this
->
getResource
())
{
return
$this
->
getResource
()->
hasAutomaticCapability
(
$capability
,
$viewer
);
}
return
$this
->
getLease
()->
hasAutomaticCapability
(
$capability
,
$viewer
);
}
public
function
describeAutomaticCapability
(
$capability
)
{
return
pht
(
'Logs inherit the policy of their resources.'
);
}
}
Event Timeline
Log In to Comment