Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F99134468
PhabricatorAuthSSHKeyController.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, Jan 21, 00:23
Size
780 B
Mime Type
text/x-php
Expires
Thu, Jan 23, 00:23 (2 d)
Engine
blob
Format
Raw Data
Handle
23712494
Attached To
rPH Phabricator
PhabricatorAuthSSHKeyController.php
View Options
<?php
abstract
class
PhabricatorAuthSSHKeyController
extends
PhabricatorAuthController
{
protected
function
newKeyForObjectPHID
(
$object_phid
)
{
$viewer
=
$this
->
getViewer
();
$object
=
id
(
new
PhabricatorObjectQuery
())
->
setViewer
(
$viewer
)
->
withPHIDs
(
array
(
$object_phid
))
->
requireCapabilities
(
array
(
PhabricatorPolicyCapability
::
CAN_VIEW
,
PhabricatorPolicyCapability
::
CAN_EDIT
,
))
->
executeOne
();
if
(!
$object
)
{
return
null
;
}
// If this kind of object can't have SSH keys, don't let the viewer
// add them.
if
(!(
$object
instanceof
PhabricatorSSHPublicKeyInterface
))
{
return
null
;
}
return
PhabricatorAuthSSHKey
::
initializeNewSSHKey
(
$viewer
,
$object
);
}
}
Event Timeline
Log In to Comment