none
Project Server 2007 Automatic Timesheet Integration to Tasks on Task Page RRS feed

  • Question

  • Hi

    We have developed Custom Code that overrides the ‘TimesheetSubmitted’ event with functionality to import all the hours from a Timesheet(Excl Administrative Tasks) that is submitted to the Task Page and submit it for Approval. Now one of the Methods that we are using in the code is in the Statusing Web Service and is called ‘ReadAssignments’. We are also Impersonating the Statusing Web Service  with the Current User that is Submitting the Timesheet.

    Now the Problem is that when the ‘ReadAssignments’ Method is Executed with Impersonation in the Event when a user is submitting a Timesheet the Code Fails and the API returns the Following Message:
    “API Error: System.Web.Services.Protocols.SoapException: ProjectServerError(s) LastError=GeneralSecurityAccessDenied Instructions: Pass this into PSClientError constructor to access all error information”

    We all know that this is a Project Server /PWA permission problem.

    For half of the Users submitting Timesheets the code works 100% for the other half of the users the code fails with the message above. Now we have figured out a way of how to resolve this but only 80% of the Time it works. What we do is go into PWA and REMOVE the Resource who is experiencing timesheet problems from all the GROUP(S) he/she is assigned to save the resource. Then Again edit the Resource in PWA and re assign them to the GROUP(S) they were assigned. Then the code will execute 100%.

    This is now causing a serious problem at our clients because half of the Timesheet Hours will reflect in the Project Schedules and the other half wont because the code failed to Execute on the ‘Timesheet –Submitted’ event.

    Any Suggestions on what we are doing wrong here? Or what we can do to Resolve this?
    We also have posted this on Other Forums and they did not have an answer.

    Thursday, July 7, 2011 11:39 AM

All replies

  • Hi,

    Are you using PJContext in your code .PJContext has references to all PSI services but as far as all requests are run under current user account you should care about any impersonation issues in your application by yourself. When you are making a ReadAssignmnet call using the PJContext.Current.PSI.ProjecTWebService, It will run under the current user's account which might not be having the permission.

    I had handled by replacing the Current user with Admin resource GUID/Name in my customized soultion.

    PJContext.Current.PSI.Current.Userid = "Replace with Admin resource guid"

    Did i make any sense?

     


    Thanks, Amit Khare |EPM Consultant| Blog: http://amitkhare82.blogspot.com http://www.linkedin.com/in/amitkhare82
    Tuesday, July 12, 2011 10:01 AM
  • Hi Amit

     

    We used the Admin Account to Configured the Timesheet Integrator to run the code of the code.

    We Created a Project Schedule in MSP named “Test Project” and created 2 Tasks and assigned it to the Admin Account and a Normal User Account and tested 2 Scenarios as follows.

     

    1<sup>st</sup> Scenario we tested as follows:

    1.       Logged in with Both Accounts .

    2.       Created a Timesheet with both Accounts and added the Tasks of the “Test Project” to the Timesheet and Submitted the Timesheets for both Accounts.

     

    The Results:

    ·         The Hours for the Admin Account went through and the Code executed 100%.

    ·         The Hours for the Normal User Account was not imported ant the API Returned a “GeneralSecurityAccessDenied” Error when Importing the Time when the “ReadAssignments” method was Executed.

     

    Then we Configured the Timesheet Integrator to use the other Normal User Account to run the code.

     

    2<sup>nd</sup>  Scenario we tested as follows:

    3.       Logged in with Both Accounts .

    4.       Created a Timesheet with both Accounts and added the Tasks of the “Test Project” to the Timesheet and Submitted the Timesheets for both Accounts.

     

    The Results:

    ·         The Hours for the Normal User Account went through and the Code executed 100%.

    ·         The Hours for the Admin Account was not imported ant the API Returned a “GeneralSecurityAccessDenied” Error when Importing the Time when the “ReadAssignments” method was Executed.

     

    So to me it seems that Impersonation is required, but like mentioned in previously then it will also fail 50% of the time with the “GeneralSecurityAccessDenied” error?

     

     

    Monday, August 1, 2011 9:06 AM