hreidemeister's picture


currently I need a script to change the access rights of a group inside a report.

With oCurrentGroup = oCurrentModel.Group() I get the group object and with mAccess = oCurrentGroup.AccessRights() I get a map of the rights. That works fine.

This maps contains the UID and a number for every entry. I guess the UID is the UID of an user or usergroup. And the number is a constant for the right the user haves. Now I could get the content in a string with mAccess.toString(), then separate the keys and a value into an array. But this cold generate problems with the type of the variables. There must be a smarter way.

In the ARIS Script helpside I found a function: mAccess.toArray(). But this line generates a TypeError: Cannot find function toArray in object ...
Also the iteration througth the map with for(var i of mAccess) generates a syntax error. I found this line in the internet.

I guess I could read of all entries by mAccess.get(key). But in this case I need all the keys. And the report must be flexible for the case, that other usergroups are generated in the database and for more then one database.

So my question is:
How can I read the keys and values of all entries in the map?
And how can I write back the changed rights into the group?

I only found the function .AccessRights() to read the map in the ARIS Script help and no function like .setAccessRights or so.

I would be very happy if anyone could help me.
Many thanks in advance.