How to get the users having read/write access of a particular model (using script)?
Hi,
well, concerning the ARIS help, this should be quite easy:
Model.Group().AcessRights()
var accessMap = ArisData.getSelectedGroups()[0].AccessRights() var it = accessMap.entrySet().iterator() while(it.hasNext()) { var entry = it.next() outfile.OutputLn(entry.getKey() + " : " + entry.getValue(), "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, Constants.FMT_BOLD | Constants.FMT_LEFT, 0) }
BR Robert
Dear Robert,
please try to explain this also.
http://www.ariscommunity.com/users/ronakgupta/2016-02-08-sementic-check-rule
var nLocale = Context.getSelectedLanguage();
var Model = ArisData.getSelectedModels();
var oGroup = ArisData.getSelectedGroups();
Model.oGroup.AccessRights()
var accessMap = ArisData.getSelectedGroups()[0].AccessRights()
var it = accessMap.entrySet().iterator()
while(it.hasNext())
{
var entry = it.next()
outfile.OutputLn(entry.getKey() + " : " + entry.getValue(), "Arial", 10, Constants.C_BLACK, Constants.C_TRANSPARENT, Constants.FMT_BOLD | Constants.FMT_LEFT, 0)
}
Argh, not really ?!? Perhaps you should try to read some other examples for scripting here...
1) If this is the complete script, you have not created an output object - so even if it runs, you won't get any results
2) var oModel = ArisData.getSelectedModels() is an array of models
3) the same for the group
4) Model.oGroup.AccessRights() does not do anything as there is not = or something like it in it. And if you want to get the group of a model, you have to call the method with ().
So this line should be:
var accessMap = Model[0].Group().AccessRights()
But you do realize that this forum is not for people learning how to script or to get trainings for free...
Robert
yeah.. ofcourse Robert, We are new in ARIS platform and we have written very few scripts till now, don't have much experience. That's why I was asking for help.
We are not trying to get "trainings for free"..
The above one is not the complete code, we are searching and trying in different ways. It was throwing different different errors, to remove that we did the editing line by line. It was the wrong way we were trying initially.
And later we also found the code you posted is available in ARIS 7.1 only as example of the AccessRights() method.
Anyway.. Thanks for your attention.