function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
phillpaffordphillpafford 

Looking for some help in creating a User Profile Security Audit with Field Level Reporting

Hi,

 

New to the SFDC world but have been given the task of generating a Security Audit Report.

 

Looking to get a breakdown of a User Profile will all levels of security reporting.

 

So I need:

User Profile, Standard Object Layouts, Custom Object Layouts, Field-Level security, Custom App Settings, Tab Settings, Record Type Settings, Administrative Permissions, General User Permissions, Standard Object Permissions, Custom Object Permissions, etc...

 

Looking to create an excel (Which I can do that part), but I'm stumbling with how to get this info. I've stated to use the API (Which I think is the only way to do this now) and have a query (Though it's not really working yet). Can anyone offer any guidence on how to go about doing this? 

 

The Query:

[CODE]

 // This will log the SF user in
include_once('../sf/sfLogin.php');

$sfQuery =<<<SFSQL
SELECT
Profile.UserType,
Profile.UserLicenseId,
Profile.SystemModstamp,
Profile.PermissionsViewSetup,
Profile.PermissionsViewAllData,
Profile.PermissionsUseTeamReassignWizards,
Profile.PermissionsTransferAnyLead,
Profile.PermissionsTransferAnyEntity,
Profile.PermissionsSolutionImport,
Profile.PermissionsSendSitRequests,
Profile.PermissionsRunReports,
Profile.PermissionsPublishMultiforce,
Profile.PermissionsPasswordNeverExpires,
Profile.PermissionsOutboundMigrationToolsUser,
Profile.PermissionsModifyAllData,
Profile.PermissionsMassInlineEdit,
Profile.PermissionsManageUsers,
Profile.PermissionsManageSolutions,
Profile.PermissionsManageSelfService,
Profile.PermissionsManageMobile,
Profile.PermissionsManageLeads,
Profile.PermissionsManageDashboards,
Profile.PermissionsManageCustomReportTypes,
Profile.PermissionsManageCssUsers,
Profile.PermissionsManageCategories,
Profile.PermissionsManageCases,
Profile.PermissionsManageCallCenters,  
Profile.PermissionsInstallMultiforce,
Profile.PermissionsInboundMigrationToolsUser,
Profile.PermissionsImportLeads,
Profile.PermissionsEditTask,
Profile.PermissionsEditReports,
Profile.PermissionsEditReadonlyFields,
Profile.PermissionsEditPublicDocuments,
Profile.PermissionsEditOppLineItemUnitPrice,
Profile.PermissionsEditEvent,
Profile.PermissionsDisableNotifications,
Profile.PermissionsCustomizeApplication,
Profile.PermissionsCreateMultiforce,
Profile.PermissionsConvertLeads,
Profile.PermissionsAuthorApex,
Profile.PermissionsApiUserOnly,
Profile.PermissionsApiEnabled,
Profile.Name,
Profile.LastModifiedDate,
Profile.LastModifiedById,
Profile.Id,
Profile.Description,
Profile.CreatedDate,
Profile.CreatedById,
(
    SELECT
        Id, Username, LastName, FirstName, department, isActive
    FROM
        Users
)  
FROM
Profile

SFSQL;
    
// Query for account id's
$response = $sfConnection->query($sfQuery);

$display = print_r($response,true);
//echo "<pre>".$display."</pre>";

displayRecursiveResults($response);

function displayRecursiveResults($arrayObject) {
    foreach($arrayObject as $key=>$data) {
        if(is_array($data)) {
            displayRecursiveResults($data);
        } elseif(is_object($data)) {
            displayRecursiveResults($data);
        } else {
            echo "Key: ".$key." Data: ".$data."<br />";
        }
    }
}

[/CODE]