HR

Hello,

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.

by Amol Patil
Posted on Tue, 04/25/2017 - 12:50

Hi Holger,

How can I read the keys and values of all entries in the map? Ans: The AccessRights() method of a Group return a java.util.Map. You can read the complete key set into an array using mAccess.keySet().toArray(). And then iterate it for each key to find the value using mAccess.get(key).   And how can I write back the changed rights into the group? Ans: You can do a read and write of Access Rights using methods of class User and UserGroup. If you build your logic to read users and usergroups first and then read their access rights on the specific group, then you dont need to read the Access Rights map from the Group. Check the help for User and UserGroup for more details.   Regards, Amol Patil

 

0
by Holger Reidemeister Author
Posted on Tue, 04/25/2017 - 15:15

In reply to by Amol

Hallo Amol,

many, many thanks for your help. :-) Your second tip works fine.

0

Featured achievement

Rookie
Say hello to the ARIS Community! Personalize your community experience by following forums or tags, liking a post or uploading a profile picture.
Recent Unlocks

Leaderboard

|
icon-arrow-down icon-arrow-cerulean-left icon-arrow-cerulean-right icon-arrow-down icon-arrow-left icon-arrow-right icon-arrow icon-back icon-close icon-comments icon-correct-answer icon-tick icon-download icon-facebook icon-flag icon-google-plus icon-hamburger icon-in icon-info icon-instagram icon-login-true icon-login icon-mail-notification icon-mail icon-mortarboard icon-newsletter icon-notification icon-pinterest icon-plus icon-rss icon-search icon-share icon-shield icon-snapchat icon-star icon-tutorials icon-twitter icon-universities icon-videos icon-views icon-whatsapp icon-xing icon-youtube icon-jobs icon-heart icon-heart2 aris-express bpm-glossary help-intro help-design Process_Mining_Icon help-publishing help-administration help-dashboarding help-archive help-risk icon-knowledge icon-question icon-events icon-message icon-more icon-pencil forum-icon icon-lock