Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F103720579
PassphraseCredential.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
Tue, Mar 4, 07:07
Size
1 KB
Mime Type
text/x-php
Expires
Thu, Mar 6, 07:07 (1 d, 20 h)
Engine
blob
Format
Raw Data
Handle
24633252
Attached To
rPH Phabricator
PassphraseCredential.php
View Options
<?php
final
class
PassphraseCredential
extends
PassphraseDAO
implements
PhabricatorPolicyInterface
{
protected
$name
;
protected
$credentialType
;
protected
$providesType
;
protected
$viewPolicy
;
protected
$editPolicy
;
protected
$description
;
protected
$username
;
protected
$secretID
;
protected
$isDestroyed
;
private
$secret
=
self
::
ATTACHABLE
;
public
static
function
initializeNewCredential
(
PhabricatorUser
$actor
)
{
return
id
(
new
PassphraseCredential
())
->
setName
(
''
)
->
setUsername
(
''
)
->
setDescription
(
''
)
->
setIsDestroyed
(
0
)
->
setViewPolicy
(
$actor
->
getPHID
())
->
setEditPolicy
(
$actor
->
getPHID
());
}
public
function
getConfiguration
()
{
return
array
(
self
::
CONFIG_AUX_PHID
=>
true
,
)
+
parent
::
getConfiguration
();
}
public
function
generatePHID
()
{
return
PhabricatorPHID
::
generateNewPHID
(
PassphrasePHIDTypeCredential
::
TYPECONST
);
}
public
function
attachSecret
(
PhutilOpaqueEnvelope
$secret
=
null
)
{
$this
->
secret
=
$secret
;
return
$this
;
}
public
function
getSecret
()
{
return
$this
->
assertAttached
(
$this
->
secret
);
}
public
function
getCredentialTypeImplementation
()
{
$type
=
$this
->
getCredentialType
();
return
PassphraseCredentialType
::
getTypeByConstant
(
$type
);
}
/* -( PhabricatorPolicyInterface )----------------------------------------- */
public
function
getCapabilities
()
{
return
array
(
PhabricatorPolicyCapability
::
CAN_VIEW
,
PhabricatorPolicyCapability
::
CAN_EDIT
,
);
}
public
function
getPolicy
(
$capability
)
{
switch
(
$capability
)
{
case
PhabricatorPolicyCapability
::
CAN_VIEW
:
return
$this
->
getViewPolicy
();
case
PhabricatorPolicyCapability
::
CAN_EDIT
:
return
$this
->
getEditPolicy
();
}
}
public
function
hasAutomaticCapability
(
$capability
,
PhabricatorUser
$viewer
)
{
return
false
;
}
public
function
describeAutomaticCapability
(
$capability
)
{
return
null
;
}
}
Event Timeline
Log In to Comment