Loading

Find Permission Sets that include CRM Analytics Permissions through SOQL

Data pubblicazione: Jun 14, 2023
Descrizione
A Permission Set License cannot be removed from a user unless all the permissions granted by the specific license are removed. Attempting to do this will result in an error similar to the following:
You can't remove the PERMISSION_SET_LICENSE_LABEL permission set license from USER_NAME until you remove the permission that requires the permission set license.

Finding which assigned permission sets contain specific permissions can be accomplished with a SOQL query.
Risoluzione
This SOQL query returns the list of Permission Sets assigned to a target User that contain CRM Analytics permissions:
 
SELECT Assignee.Name, PermissionSet.Label, PermissionSet.Id FROM PermissionSetAssignment WHERE PermissionSetId in (SELECT Id FROM PermissionSet WHERE PermissionsInsightsAppUser = true OR PermissionsInsightsAppAdmin = true OR PermissionsAddAnalyticsRemoteConnections = true OR PermissionsInsightsAppDashboardEditor = true OR PermissionsInsightsAppUploadUser = true OR PermissionsInsightsCreateApplication = true OR PermissionsInsightsAppEltEditor = true OR PermissionsWaveTabularDownload = true OR PermissionsManageTemplatedApp = true OR PermissionsUseTemplatedApp = true) AND AssigneeId = 'USER_ID'

Replace USER_ID with the Id of the target user.

If your org has Trend Reports in Analytics enabled, add the following to the statement:

OR PermissionsWaveTrendReports = true


Use the resulting list to determine which permission sets need to be unassigned from the user.

Resources

Permission Sets
Manage Permission Set Assignments
PermissionSet Object
PermissionSetAssignment Object

 
Numero articolo Knowledge

000380812

 
Caricamento
Salesforce Help | Article