Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F80253423
PassphraseCredentialAuthorPolicyRule.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, Aug 30, 17:35
Size
1021 B
Mime Type
text/x-php
Expires
Sun, Sep 1, 17:35 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
20331126
Attached To
rPH Phabricator
PassphraseCredentialAuthorPolicyRule.php
View Options
<?php
final
class
PassphraseCredentialAuthorPolicyRule
extends
PhabricatorPolicyRule
{
public
function
getObjectPolicyKey
()
{
return
'passphrase.author'
;
}
public
function
getObjectPolicyName
()
{
return
pht
(
'Credential Author'
);
}
public
function
getPolicyExplanation
()
{
return
pht
(
'The author of this credential can take this action.'
);
}
public
function
getRuleDescription
()
{
return
pht
(
'credential author'
);
}
public
function
canApplyToObject
(
PhabricatorPolicyInterface
$object
)
{
return
(
$object
instanceof
PassphraseCredential
);
}
public
function
applyRule
(
PhabricatorUser
$viewer
,
$value
,
PhabricatorPolicyInterface
$object
)
{
$author_phid
=
$object
->
getAuthorPHID
();
if
(!
$author_phid
)
{
return
false
;
}
$viewer_phid
=
$viewer
->
getPHID
();
if
(!
$viewer_phid
)
{
return
false
;
}
return
(
$viewer_phid
==
$author_phid
);
}
public
function
getValueControlType
()
{
return
self
::
CONTROL_TYPE_NONE
;
}
}
Event Timeline
Log In to Comment