2 Replies Latest reply on Feb 14, 2011 4:57 PM by Jeremy Schmidt

    Run add-in as another user

    Jeremy Schmidt

      I am attempting to run an EPDM add-in as another user.  In my situation, I do not want to grant users the rights to rename files at a particular state.  Instead, I'd like them to use an add-in to rename the files.

       

      My first thought was to setup a task and have it run as a particular user.  This seems to work, but isn't nearly as fast as a standard add-in.

       

      My next thought was to have the add-in push the file to another state in which the user would have permissions to rename the file and then push it back to the original state.  This would work, but seems like more work than necessary.

       

      Ideally, I'd like the add-in to "grant" the user permissions to rename the file.  After looking through the API, it doesn't appear that you can change user permissions to a state.  I see that you can login to another vault as a user, but this doesn't help either.

       

      Does anyone know of a way to run a particular task as a different user?  I have a "Rename" user setup that has permissions to rename a file.  I'd like to execute the rename command as this user.  I'm open to any other suggestions as well.

       

      Thanks for your time.

        • Re: Run add-in as another user
          Roland Schwarz

          There is a way to run an application as another user, but I don't believe it works for addins or other DLLs.  DLLs run attached to other processes, and I don't think there is a way to do that while running as a user different from the owning process.

           

          For EXEs, there are ways to run as another user.

          • Re: Run add-in as another user
            Jeremy Schmidt

            In case anyone is interested, I figured out how to do this. Basically, you create another vault instance (vaultRename) and log into that vault instance with the desired user ("Rename").  Then use the new vault instance with the rest of your code.

             

            Dimvault As IEdmVault11

            DimvaultRename As IEdmVault11

            vault = poCmd.mpoVault

            vaultRename = New EdmVault5

            vaultRename.Login("Rename","password", vault.Name)