1 Reply Latest reply on Feb 15, 2013 9:36 AM by Greg Rupp

    API to set Read File Contents (workflow permission) for specific user.

    Benjamin Abshire

      I am trying to develop a method in vb.net of setting the workflow state permission "Read File Contents" on for every state in our vault for a specific user. I have already given that user "Read File Contents" permission for every folder in the vault, but without the matching State permission the files are still hidden. I have the user's ID and state.ID for every state but I'm failing to find the equivalent of IEdmState6.UserPermission, IEdmUser9.StatePermission or edmStatePermission. Any suggestions are greatly appreciated

       

      For anyone interested I included the code to list all workflows and their included state names.

       

          Private Sub WorkflowNames(ByVal Vault As IEdmVault7)
              Dim WorkFlowMgr As IEdmWorkflowMgr6
              Dim WorkFlow As IEdmWorkflow6
              Dim state As IEdmState6
              Dim pos As IEdmPos5
              Dim pos2 As IEdmPos5

       

              WorkFlowMgr = Vault
              pos = WorkFlowMgr.GetFirstWorkflowPosition

       

              While Not pos.IsNull
                  WorkFlow = WorkFlowMgr.GetNextWorkflow(pos)
                  Debug.Print(WorkFlow.Name)
                  pos2 = WorkFlow.GetFirstStatePosition
                  While Not pos2.IsNull
                      state = WorkFlow.GetNextState(pos2)
                      Debug.Print("->" & state.Name & ", ID:" & state.ID)
                  End While
              End While
          End Sub

       

      The output looks like this:

      ...

      Controlled Drawings

      ->Design, ID:30

      ->Engineering Review, ID:200

      ->Drawing Review Board, ID:202

      ->Pending Release Approval, ID:308

      ->Released, ID:344

      ...

       

      Thanks

        • Re: API to set Read File Contents (workflow permission) for specific user.
          Greg Rupp

          Hi Benjamin,

             I'm not sure I can answer your specific question, but I do have another suggestion. Create a new group for read-only people. That way, if you get more users like this one, you can simply assign them to the proper group.

           

          Also, in the user and/or group permissions (in admin tool), you should be able to select all states in a workflow and set them with the proper permissions in just a few. Clicks. I could see the need for your API if you've got a ton of workflows.

           

          Good luck.

          Greg