Importing MDAC permissions using an AppEngine process and Im not seeing the ability to set "Pass" permissions for dimension permissions.
The documentation only gives guidance for the first 4.
https://docs.infor.com/depm/2023.x/en-us/depmolh_cloud/default.html?helpcontent=olap_security_cloud/qfw1510174478410.html&hl=mdac
Hoping I dont have to loop through every element and set "No Access". I tried 4 but it gives a "could not be imported" error.
Matthew. Sadly cascading permissions are not currently supported in MDAC cubes. I suggest using a processes where you pass in the parent ID and it gets a list of children.- here for entityEntityList2 = OLAPGetChildElementList(OlapCon1, "Entity", enttop, false);Then create a data area and use OLAPSetDataAreaValue(cubeVals, valuenew); to set the permission. The data type for valuenew must be integer and 2=Write, 1=Read, 0=None. -1 = Default Complete process (which isn't generalised and is for an MDAC cube with 3 dimensions - below)
#define EngineVersion 5.0#define RuntimeVersion 5.0
bool CubeMDACSetValue(string application, string cube, string enttop, string group, string version, int valuenew)@Parameter[application]: "Application e.g. Junk";@Parameter[cube]: "The cube to write values to e.g. #Security_Test.";@Parameter[valuenew]: "The integer value to be written to selected elements. 2=Write, 1=Read, 0=None. -1 = Default";@Parameter[enttop]: "The top entity e.g. Norway.";@Parameter[group]: "The selected group e.g. DR_Norway.";@Parameter[version]: "The selected version e.g. Budget or Forecast 1.";@Description: "Sets MDAC cube values to the specified value.";@Category: "Utilities";@Returns: "True";{ //Version 2 - John Robson 19-July-2022 OLAPConnection OlapCon1 = OLAPCreatePooledNamedConnection(application); OLAPElement entpar = OLAPGetDimensionElement(OlapCon1, "Entity", enttop); OLAPElementList EntityList = CreateOLAPElementList(); OLAPElementList EntityList2 = CreateOLAPElementList(); OLAPElementListAddElement(EntityList, entpar); EntityList2 = OLAPGetChildElementList(OlapCon1, "Entity", enttop, false); foreach (OLAPElement el in EntityList2) { OLAPElementListAddElement(EntityList, el); //WriteLine(el); }
//OLAPDataArea cubeVals = OLAPCreateDataArea(OlapCon1, "Cube", OlapDataAreaIncludeB | OlapDataAreaSuppressNull, OlapDataAreaOperatorEqual, 0.0, OlapDataAreaOperatorNone, 0.0); OLAPDataArea cubeVals = OLAPCreateDataArea(OlapCon1, cube, OlapDataAreaIncludeC, OlapDataAreaOperatorNone, 0.0, OlapDataAreaOperatorNone, 0.0 ,EntityList, version, group); if (valuenew >= 0) { OLAPSetDataAreaValue(cubeVals, valuenew); } else { OLAPDeleteDataArea(cubeVals); WriteLine("Clearing data area which assigns defult permissions."); } return true;}
Thanks John, that was my next step but didnt want to spend all that time writing the code if it was simple property. Would it be worth an ER or is there a larger limitation in the Infor OLAP code base that doesnt allow that?
Thanks for the help
Matthew - yes raise an ER. It's a useful way of finding out who else would like the feature. Cascading is by far the best option as it allows for new children to inherit the intended permission. It's technically feasible but there is already a lot of significant and actually quite exciting dev tasks ahead of it so as I recall it's not on the roadmap yet.
John, been working with this code the last few days and struggling to get it to work. Wonder if you could provide a bit more clarity on this as the documentation is rather sparse, specifically around OLAPSetDataAreaValue:
using these parameters, Im getting an error at OLAPSetDataAreaValue(cubeVals, iValueNew):
Index was out of range. Must be non-negative and less than the size of the collection.
What does the value argument for OLAPSetDataAreaValue represent in my face when working with the MDAC? I feel like Im not building the coordinates for the Data Area correctly?
MatthewI am happy to offer a call to take a look next week if that helps. Fortunately I still have the Application with an Ap Studio report which calls the process. If that would help please email me john.robson@infor.com but note that due to the Coronation of King Charles that Monday is a public holiday in the UK,
sent an email last friday, also posted the issue in a new thread in case youre swamped this week. thanks again.