Synchronize PWA Site Root Permissions to Newly Created Projects
-
4 mai 2012 16:58
Hey Everyone,
I need to implement an Event Handler that automatically synchronizes permissions specified at the PWA root with permissions for the project and its associated sharepoint workspace. The built-in synchronization option 'automatically synchronize Project Web App users with Project Sites when they are created' is not working for us.
I was hoping a simple call such as
WssInteropWS.WssInterop.QueueSynchronizeMembershipForWssSite( e.ProjectGuid, job );
would solve the problem, but this raises a GeneralQueueJobFailure.
Any ideas?
Toate mesajele
-
7 mai 2012 05:30
Hi Paul,
I am sure that you know project site is created when the project is created & published. Are you calling the QueueSynchronizeMembershipForWssSite when the project is created event. Can you please try for onpublished event & see if that works.The built-in synchronization option 'automatically synchronize Project Web App users with Project Sites fires wehn the project is published.
Did you try debugging the event handler to see if that returns any project site url which needs to ne synchronized on created event?
Thanks, Amit Khare |EPM Consultant| Blog: http://amitkhare82.blogspot.com http://www.linkedin.com/in/amitkhare82
-
10 mai 2012 17:12
Thanks for your help Amit,
I was using the project created event, and I have tried using the onPublished event to no avail. In the code below, projectWorkspaceUrl = http://server:port/pwa, and i append the name of the project to get the web url. Using this url i try to get the SPWeb for the project's workspace, but it returns an error "Cannot set permissions on root level site PWA"
try { SPWeb myNewWeb = GetSPWeb( projectWorkspaceUrl + "/" + projectName.Replace( " ", "%20" ) + "/" ); myNewWeb.ResetRoleInheritance(); myNewWeb.Update(); ULSLogHelper.WriteCommentToULSLog( "Completed" ); }