We need to provide access to the following:
- A list of all users, their status roles, permissions, and basic info (user name, email, business unit, etc.)
- A list of all permissions
- A list of all roles
- Relation between roles and permissions
- Relation between users and roles
- Relation between users and roles (this is relevant due to custom permission options that are out of the scope of the role)
We can use REST API, SOAP API, AMPScript, or SQL quarry. Or whatever is suggested.
I was only able to access the AccountUser object using SOAP API. But it doesn't have all the info I need.
For instance in case of a custom permission I get this: Individual role for XXX Individual role for XXX Individual role for XXX>
Maybe some of the information can be found under PermissionSet object, but it is not retrievable.
Any idea how to gain access to the needed information?
Here are the sources I found related so far but was not enough to solve this conundrum:
- https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/accountuser.html
- https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/permissionset.html
- https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/supported_operations_for_objects_and_methods.html?fireglass_rsn=true.html#fireglass_params&tabid=ac297959fcac2f8e&application_server_address=firegtiep04.hq.corp.phoenix.co.il&popup=true&is_right_side_popup=false&start_with_session_counter=1
- Retrieving User Details using SOAP API
- Read AccountUser's assigned to BusinessUnit in Enterprise Account
- User Permission Access Report
- https://help.salesforce.com/s/articleView?id=sf.mc_overview_enterprise_user_permissions.htm&type=5
Edit
Following the commenters, I have tried to retrieve AccountUsers from the BusinessUnit Object using SSJS WSProxy. But no I'm getting an error:
The Request Property(s) AccountUsers do not match with the fields of BusinessUnit retrieve
This corresponds to the described Object check I did, AccountUsers cannot be retrieved.
Note: This was executed using a cloud page on the top parent BU.
Retrieve code:
var prox = new Script.Util.WSProxy();
try {
var soapObject = "BusinessUnit";
var colsArr = ["Name", "IsActive", "ParentName", "AccountUsers"];
var res = prox.retrieve(soapObject, colsArr);
if (res.Status == "OK") {
Write(Stringify(res));
}else{
Write("res.Status = "+ res.Status);
}
} catch (error) {
Write(Stringify(error));
}