Sparx Systems Forum
Enterprise Architect => General Board => Topic started by: rupertkiwi on May 02, 2018, 12:21:25 pm
-
Is it possible to restrict specific scripts based on which group a user belongs to?
In a similar way that diagrams or packages can be locked depending on which group a user is a member of?
I can restrict the running and editing of all scripts based on a user's group via the Security Group settings but it would be good to restrict individual scripts
Thanks,
Rupert
-
Hi Rupert,
Not out of the box, but you can of course test the current user in your script yourself, and refuse to execute if she doesn't meet your requirements.
Geert
-
OK, thanks Geert for your prompt reply.
I will have a play around and see how I go
Cheers,
Rupert
-
Use the following function in JScript-type script and validate it in the logic of your script:
function isUserInGroup(groupGUID) {
var userGUID = Repository.GetCurrentLoginUser(true);
var result = DBGetFieldValueArrayString("GroupID", "t_secusergroup", "UserID = '" + userGUID + "' AND GroupID = '" + groupGUID + "'");
if(result.length == 0) {
return false;
}
return true;
}