Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Content Management (Extended ECM)
API, SDK, REST and Web Services
Workflow Script - Attachment
Tod_Funk
Want to change the permissions of default group for the worklow attachments folder from nothing to See and SeeContents. The following call back script does not work.Any idea why ? Please help !!!!function Dynamic ChangePermissions( \ Object prgCtx, \ WAPIWORK work, \ Integer workID, \ Integer subWorkID, \ Integer taskID, \ Integer returnSubWorkID, \ Integer returnTaskID, \ Dynamic extraData = Undefined ) Dynamic retVal Dynamic userID Dynamic perms Assoc retAssoc DAPINODE node Object llnode Dynamic type type = 2 /* type is user */ userID = 1001 /* current user */ node = .GetAttachmentData(prgCtx, work ) llnode = $LLIApi.LLNodeSubsystem.GetItem( node.pSubType ) perms = Assoc.CreateAssoc() perms.See = 128 perms.SeeContent = 128 retVal = llnode.NodeRightUpdate( node, type,userID, perms ) return( retVal ) end
Find more posts tagged with
Comments
Donna Nalls
Hi Larisa,My questions are numerous, but let me start with the basics:1) Can you determine where the script is failing?? If it is making it as far as your call to NodeRightUpdate(), what is the error message being returned?2) I am seeing a lot of hard-coded numbers and ids in this script - you should avoid doing that if possible, as you might find yourself fixing a lot of code down the road.3) Not sure how your workflow template is set up, but it looks like you are making the assumption that the DefaultGroup will always be included in the NodeRights...if that is the case, why not simply set the permissions on the workflow template????4) Remember that an event script processes as the user that has performed the last step - so, if your user does not have permission to change the permissions of the attachments folder, then it will not work.5) Finally, when I call NodeRightUpdate, i usually just pass my bitmask with the permissions that i want....the way you have done it, will work (except for the hard-coded 128 is not a good idea)...try using $PSee | $PSeeContents as your final arg in to NodeRightUpdate (instead of the assoc).These are just a few thoughts - if you send the error message that you are receiving, it would be most helpful.Best,Donna