sherenegladysj - Thursday, February 18, 2010 6:58 AM:
Hello all,
I have a scenario like this;
There are two Group Identities A & B ; Part created by one member of group identity (A) should not be visible to the members of other group identity (B). Members of same group should be able to see all the parts created among the group.
How about adding the Group Identity as a member to Owner Identity when the particular user logs in? I tried this option, but it's not working.
Is there any other way? Is it possible to achieve this?
Thanks in advance,
Sherene
RobMcAveney - Thursday, February 18, 2010 10:20 AM:
The Owner and Manager Identities can be used to do what you want, but you shouldn't edit them directly (if you've added members you should delete them). The membership for these identities are resolved at runtime based on the identities assigned to the owned_by_id (labeled "Assigned Creator") and managed_by_id (labeled "Designated User") properties on the item. In your case, you should set owned_by_id to Group A on parts created by Group A. In Permissions, you should make sure that the Owner identity has Get Access and turn off Get Access for all identities that members of Group B might also be in (e.g. "All Employees"). Remember that Permissions can change (often with a Lifecycle Promotion), so you may have to edit multiple Permissions to get it working.
Rob
sherenegladysj - Tuesday, March 2, 2010 7:19 AM:
Hello Rob,
Thanks for your suggestion. I've written client side method to set the owned_by_id as Group Identity A based on the user logged-in.
var partItem = myInnovator.newItem("Part","get");
partItem.setProperty("created_by_id",IdentityUserID);
partItem.setAttribute("select","owned_by_id");
partItem = partItem.apply();
partItem.setAttribute("action","edit");
partItem.setProperty("owned_by_id",targetID); ' targetID is the Group Identity ID
partItem = partItem.apply();
This code is not setting the owned_by_id as Group Identity ID. I don't know where I've gone wrong? Can u pls. check this?
Thansk & REgards,
Sherene
RobMcAveney - Tuesday, March 2, 2010 8:32 AM:
Try something like this as an OnAfterNew Client Event on Part:
// Called OnAfterNew
var inn = this.getInnovator();
// Get the group identities
var groupA = inn.getItemByKeyedName("Identity","Group A");
var groupB = inn.getItemByKeyedName("Identity","Group B");
// IdentityList contains the ids of all the current user's identities
var identityList = top.aras.getIdentityList();
if (!identityList) { top.aras.AlertError("Identity list empty"); return this; }
// Check the IdentityList against the groups. Set both id and keyed name for the matching one
if (identityList.indexOf(groupA.getID())>-1)
{
this.setProperty("owned_by_id", groupA.getID());
this.setPropertyAttribute("owned_by_id", "keyed_name", groupA.getProperty("keyed_name", ""));
}
else if (identityList.indexOf(groupB.getID())>-1)
{
this.setProperty("owned_by_id", groupB.getID());
this.setPropertyAttribute("owned_by_id", "keyed_name", groupB.getProperty("keyed_name", ""));
}
else
{ top.aras.AlertError("User is in neither Group A nor Group B"); }
return this;
Note that this sets the property on the client-side item, but does not do an apply(). Think of apply() as a save operation, which you wouldn't want to do in this case -- you want to set the value and let the user save interactively. If you don't want the user to be able to change the identity you may want to enforce this rule server-side with an OnBeforeAdd/OnBeforeUpdate method.
Rob
dbhiggi - Thursday, June 24, 2010 5:13 PM:
Hi, Rob.
I have a remotely similar question.
Looking at the ECN life cycle and workflow, if the CSII is going to select the Reject path out of the Review Documents activity, I would like the CSII to have the capability to designate a different Owner prior to making that vote.
The CSII can change the contents of the field on the ECN form, but it doesn't seem to change the assigned Owner in the workflow.
I'd appreciate any suggestions.
Thanks.
Dave