Changeset View
Changeset View
Standalone View
Standalone View
src/applications/auth/controller/PhabricatorAuthSSHKeyController.php
Show All 19 Lines | protected function newKeyForObjectPHID($object_phid) { | ||||
} | } | ||||
// If this kind of object can't have SSH keys, don't let the viewer | // If this kind of object can't have SSH keys, don't let the viewer | ||||
// add them. | // add them. | ||||
if (!($object instanceof PhabricatorSSHPublicKeyInterface)) { | if (!($object instanceof PhabricatorSSHPublicKeyInterface)) { | ||||
return null; | return null; | ||||
} | } | ||||
return id(new PhabricatorAuthSSHKey()) | return PhabricatorAuthSSHKey::initializeNewSSHKey($viewer, $object); | ||||
->setObjectPHID($object_phid) | |||||
->attachObject($object); | |||||
} | } | ||||
} | } |