none
Getting the GUID of currently logged on user through PSI RRS feed

  • Question

  • Hello,

    I have a need of getting the GUID of a user currently logged on to Project Server while within a workflow.  The ResourceWebService has a method called GetCurrentUserUid(), but unfortunately it returns the GUID of the proxy (system) account, since, I believe, once inside a workflow, everything is done on behalf of that user.

    Does anyone know of a way of getting the information (well, GUID) of the physical user at the moment of the call inside a workflow (not the workflow inititiaor or the project owner)?

    Thank you,
    Ilya

    UPDATE: I also wanted to add that, in lieu of workflow proxy account being in control throught workflow execution, SecurityWebService's CheckUserProjectPermission(s) method is absolutely worthless, because as far as the service is concerned, the current user is the proxy account and not the logged on user, therefore all the permissions (well, at least the ones I'm checking for) are always true, because proxy account is usually in the administrator's group and has permissions for nearly everything. 

    In my opinion, if not a bug, it's definitely something that needs rework.  Any xxx_GetUserRelatedGUID methods in any of the web services will not be doing what they are supposed to do if called from within a workflow. 


    • Edited by Rockmus Wednesday, October 12, 2011 6:35 PM
    Wednesday, October 12, 2011 6:10 PM

Answers

  • Hi Rockmus,

    I'm not 100% sure about this but I don't think it is possible. When in a workflow it will (and should) always return the workflow proxy user.

    The focus can be given to the workflow from different places (not just by using the Submit button in PWA). So when the workflow is executing there might not be a 'currently logged on user' (or he might have already logged out).

    Regards,
    Hans


    My EPM blog: Projectopolis
    • Marked as answer by Rockmus Friday, November 11, 2011 8:05 PM
    Friday, October 14, 2011 6:02 AM
    Moderator

All replies

  • Hi Rockmus,

    I'm not 100% sure about this but I don't think it is possible. When in a workflow it will (and should) always return the workflow proxy user.

    The focus can be given to the workflow from different places (not just by using the Submit button in PWA). So when the workflow is executing there might not be a 'currently logged on user' (or he might have already logged out).

    Regards,
    Hans


    My EPM blog: Projectopolis
    • Marked as answer by Rockmus Friday, November 11, 2011 8:05 PM
    Friday, October 14, 2011 6:02 AM
    Moderator
  • Hi Hans,

    Thanks for the answer.  Makes sense, but personally I can't even think of a situation where you would be referencing the workflow from a place other than PWA.  It seems like the majority of the interaction is done from there.  After all, this is a user-oriented solution, so it's expected that buttons are to be pressed in order to trigger actions.

    Ilya

    Friday, October 21, 2011 6:02 PM
  • Hi All,

    Any workaround on this ?

    Have posted almost a similar question: http://social.technet.microsoft.com/Forums/en-US/project2010custprog/thread/8d132362-f6fb-45ec-a21f-f5b91ef04eab

    Let's hope someone has found an alternative method.

    Regards.

    Monday, November 28, 2011 11:16 AM
  • Why not create a custom field. Insert Javascript in your pdp, and hide the field, but write to its hidden value. Once the form is saved, you have any value you want.
    Monday, November 28, 2011 7:12 PM
  • Cmb,

    What exactly are you suggesting to write to the field?  I'm not following this approach.

    Ilya

    Tuesday, November 29, 2011 4:28 PM
  • It looks like 'g_sUserName' (javascript) contains the logged on user on some pages
    • Edited by cmb9999 Wednesday, November 30, 2011 4:02 PM
    Wednesday, November 30, 2011 4:02 PM