I have a mashup where im using the service GetProperties, in the Data Properties section i have the checkbox "Automatically update values when new values are available." selected.
When I run my mashup passing the appkey through the link that access the mashup when I use my admin user it run properly the Data Propertie I checked, but when I change the appkey to my viewer user it doesnt work properly.
I have given permission to the user in the Run Time permissions i checked every box as Allow, and in the visibility I inserted the user organization, for both the mashup and thing. Also in thr User Profile the option for Subsystem is also checked.
I dont know what am I doing wrong and why when I change the appkey to my user that's not an admin the "Automatically update values when new values are available." doesnt work properly in my mashup. Any suggestions?
There is this article for the GetProperties permissions: https://www.ptc.com/en/support/article/CS322093?as=1
It's a little tricky as in the background it uses the BrowserGateway-ThingTemplate which needs permissions as well.
Hi @GV_11098078 there you need to provide some additional permissions to entity Browser Gateway.
Here is the code you need to execute it with your usergroup.
// VISIBILITY PERMISSIONS
let projectVisibilityPermissionEntities = [
// ThingTemplates["BrowserGateway"],
Resources["AlertFunctions"],
Resources["EntityServices"],
Subsystems["PlatformSubsystem"],
Subsystems["AlertProcessingSubsystem"],
Subsystems["EventProcessingSubsystem"],
Resources["RuntimeLocalizationFunctions"],
Resources["CurrentSessionInfo"],
Resources["InfoTableFunctions"],
StyleThemes["PTC Convergence Theme"],
LocalizationTables["de"],
];
projectVisibilityPermissionEntities.forEach((entity) => {
entity.AddVisibilityPermission({
principal: "write your name of organization here",
principalType: "Organization"
});
});
// RUNTIME PERMISSIONS
// let c = {
// Resources["EntityServices"]: ["GetClientApplicationKey"]
// ThingTemplates["BrowserGateway"]: ["*"]
// };
// EntitiyServices: Visibility + GetClientApplicationKey service
// BrowserGateway Instances RunTime: All Properties and services
Resources["EntityServices"].AddRunTimePermission({
allow: true,
principal: "write your usergroup here",
principalType: "Group",
resource: "GetClientApplicationKey",
type: "ServiceInvoke"
});
Resources["RuntimeLocalizationFunctions"].AddRunTimePermission({
allow: true,
principal: "write your usergroup here",
principalType: "Group",
resource: "GetEffectiveToken",
type: "ServiceInvoke"
});
ThingTemplates["BrowserGateway"].SetRunTimePermissionsAsJSON({
permissions: getRuntimePermissionsJson("Users")
});
ThingTemplates["BrowserGateway"].SetInstanceRunTimePermissionsAsJSON({
permissions: getRuntimePermissionsJson("Users")
});
Subsystems["EventProcessingSubsystem"].SetRunTimePermissionsAsJSON({
permissions: getRuntimePermissionsJson("Users")
});
Subsystems["EventProcessingSubsystem"].SetInstanceRunTimePermissionsAsJSON({
permissions: getRuntimePermissionsJson("Users")
});
function getRuntimePermissionsJson(groupName) {
return {
"permissions": [
{
"resourceName": "*",
"EventSubscribe": [
{
"isPermitted": true,
"name": groupName,
"type": "Group"
}
],
"PropertyWrite": [
{
"isPermitted": true,
"name": groupName,
"type": "Group"
}
],
"PropertyRead": [
{
"isPermitted": true,
"name": groupName,
"type": "Group"
}
],
"ServiceInvoke": [
{
"isPermitted": true,
"name": groupName,
"type": "Group"
}
],
"EventInvoke": [
{
"isPermitted": true,
"name": groupName,
"type": "Group"
}
]
}
]
};
}
