04-02-2012 08:36 AM
My eForm become un-editable, some fields on the eForm are changed to read only, or the whole eForm can be edited which all scenarios depend on login users. If it is in one WF, I can use properties to control users or user groups, but the same eForm exists in three parallel WFs. Can Unity API check which user group or role the current login user belongs to? Could you provide some code examples?
I appreciate.
04-03-2012 06:42 AM
Off the Application object, you can get the current user object. Off this user object you can get any user groups for this user.
app.CurrentUser.GetUserGroups();
04-08-2012 10:26 AM
Coulut you provide some code example? I want to check one user group and pass to property bag. My WF will copy the peroperty to the eForm and eForm Javascript will control the editable pemmission based on the user group.
I have some code, but it has some error, could you help me?
public void OnWorkflowScriptExecute(Hyland.Unity.Application app, Hyland.Unity.WorkflowEventArgs args)
{
User CurrentUser = app.CurrentUse
PropertyBag sessionPropertyBag = args.SessionPropertyBag;
if (CurrentUser != null)
{
UserGroupList userGroupList = CurrentUser.GetUserGroups();
foreach (UserGroup userGroup in userGroupList)
{
foreach( Name name in userGroup.Name)
{
if (name="OBRCAFinanaceWR")
{
sessionPropertyBag.Set(propUserGroup, name);
}
}
}
}
}
04-09-2012 06:37 AM
Each user group object in the list of user groups has an Id and a Name.
foreach (UserGroup userGroup in userGroupList)
{
if (userGroup.Name == "OBRCAFinanaceWR")
{
sessionPropertyBag.Set(propUserGroup, userGroup.Name);
break;
}
}
04-09-2012 07:16 AM
if (name="OBRCAFinanaceWR")
...is an assignment, it should be a comparison...
if (name == "OBRCAFinanaceWR")
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.