1 Reply Latest reply: Jul 8, 2013 5:03 AM by Dror Svartzman RSS

    QMS API: DocumentMetaData.Authorization.Access

    Dror Svartzman

      Hi,

       

      we're running QV SBS 11SR1.

       

      We have no publisher installed and we grant/remove document permissions by embedding for each document an Section Access\Section Application scriplet.

       

      We would like  to gain access to all authorized users per given document.

       

      To that end i've used the following script;

       

       //create a QMS API client
                     m_apiClient = new QMSClient();
                     ServiceKeyClientMessageInspector.ServiceKey = m_apiClient.GetTimeLimitedServiceKey();
      
      
                     m_Qv_AllDocuments = ListAllDocuments();
      
                     foreach (Qv_Document QvDoc in m_Qv_AllDocuments)
                     {
                     DocumentNode m_docNode = QvDoc.documentnode;
                     DocumentMetaData metaData = m_apiClient.GetDocumentMetaData(m_docNode, DocumentMetaDataScope.Authorization);
            
                         foreach (DocumentAccessEntry docAccessEntry  in metaData.Authorization.Access)
                         {
                             if (docAccessEntry.UserName == User)
                             {
                                 m_Qv_DocumentsPerUser.Add(QvDoc);
                             }
                         }
      
      
                     }
      

       

      The above code iterates through all user documents. It than tries to loop through all Doc's DocumentAccessEntry's trying to find UserName matching the function parameter.

       

      This does not work. .For some reason, the metaData.Authorization.Access is empty for all documents.