Creating an "admin" user?

How can I create a user in the portal with all portal permissions?

Answers

Answer

Users can be created with SoftLayer_User_Customer::createObject. The newly created user will have access to interact with all hardware and CCIs on the account, but will have no action permissions.

This PHP example will give the user all portal permissions by first gathering the list of possible permissions, then passing that list to SoftLayer_User_Customer::addBulkPortalPermission.

<?php
 
require_once('SoftLayer/SoapClient.class.php');
 
/**
 * Set your SoftLayer API username and key.
 */
$apiUsername = 'SET ME';
$apiKey = 'SET ME TOO';
$userId = 0 // SET ME ALSO
 
 
$permissionClient = Softlayer_SoapClient::getClient('SoftLayer_User_Customer_CustomerPermission_Permission', null, $apiUsername, $apiKey);
$userClient = SoftLayer_SoapClient::getClient('SoftLayer_User_Customer', $userId, $apiUsername, $apiKey);
 
try {
	$permissions = $permissionClient->getAllObjects();
   	$result = $userClient->addBulkPortalPermission($permissions);
} catch ( Exception $e) {
	die( $e->getMessage());
}