Ask a questionAsk a question
 

AnswerHow to UndoCheckout for specific user

  • Thursday, October 22, 2009 12:19 AMgfilkov Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    The VSS helper tool I am developing includes (well, as a menu option so far) the feature to mass-undo checkouts of a specific user.
    Visual SourceSafe Explorer allows to do that, but in a very boring item-by-item manner.

    I can call IVSSItem->UndoCheckout(), and it will work, but just for MY checkouts.
    The tool impersonates the Admin user and should be able to undo checkouts of any user.

    IVSSItem->UndoCheckout() does not provide for passing the user as parameter.
    IVSSCheckout has BSTR Username() property, but there is no way to obtain IVSSItem from IVSSCheckout instance.

    Please help.
    Thanks

Answers

  • Wednesday, October 28, 2009 4:45 PMgfilkov Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Thanks Chao.
    That is what I am doing in my code.
    In a clumsy way though - I have to reset the user's password first.
    >In my opinion the check out action should be done by the user, not the tool, it is not reasonable.
    I don't think so. Please note in my post "Visual SourceSafe Explorer allows to do that...", so MS finds it reasonable ;)
    The operation is mostly applied for the checkouts of the user who has already left the company.
    Best regards,
    GF

All Replies

  • Tuesday, October 27, 2009 12:21 PMChao KuoMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hello, 
    I think the only way is to log using the specific user's user name and password, by passing the parameter to IVSSDatabase.Open. But this will make the file be checked out in the your help tool side.
    In my opinion the check out action should be done by the user, not the tool, it is not reasonable. 
    Thanks
  • Wednesday, October 28, 2009 4:45 PMgfilkov Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Thanks Chao.
    That is what I am doing in my code.
    In a clumsy way though - I have to reset the user's password first.
    >In my opinion the check out action should be done by the user, not the tool, it is not reasonable.
    I don't think so. Please note in my post "Visual SourceSafe Explorer allows to do that...", so MS finds it reasonable ;)
    The operation is mostly applied for the checkouts of the user who has already left the company.
    Best regards,
    GF