{"action":"closed","issue":{"url":"https://api.github.com/repos/AzureAD/rms-sdk-for-cpp/issues/15","labels_url":"https://api.github.com/repos/AzureAD/rms-sdk-for-cpp/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/AzureAD/rms-sdk-for-cpp/issues/15/comments","events_url":"https://api.github.com/repos/AzureAD/rms-sdk-for-cpp/issues/15/events","html_url":"https://github.com/AzureAD/rms-sdk-for-cpp/issues/15","id":90734214,"number":15,"title":"Policy name and description not persisted through unprotection","user":{"login":"joshgav","id":4421720,"avatar_url":"https://avatars.githubusercontent.com/u/4421720?v=3","gravatar_id":"","url":"https://api.github.com/users/joshgav","html_url":"https://github.com/joshgav","followers_url":"https://api.github.com/users/joshgav/followers","following_url":"https://api.github.com/users/joshgav/following{/other_user}","gists_url":"https://api.github.com/users/joshgav/gists{/gist_id}","starred_url":"https://api.github.com/users/joshgav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshgav/subscriptions","organizations_url":"https://api.github.com/users/joshgav/orgs","repos_url":"https://api.github.com/users/joshgav/repos","events_url":"https://api.github.com/users/joshgav/events{/privacy}","received_events_url":"https://api.github.com/users/joshgav/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/AzureAD/rms-sdk-for-cpp/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":{"login":"munjaldoshi","id":2213691,"avatar_url":"https://avatars.githubusercontent.com/u/2213691?v=3","gravatar_id":"","url":"https://api.github.com/users/munjaldoshi","html_url":"https://github.com/munjaldoshi","followers_url":"https://api.github.com/users/munjaldoshi/followers","following_url":"https://api.github.com/users/munjaldoshi/following{/other_user}","gists_url":"https://api.github.com/users/munjaldoshi/gists{/gist_id}","starred_url":"https://api.github.com/users/munjaldoshi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/munjaldoshi/subscriptions","organizations_url":"https://api.github.com/users/munjaldoshi/orgs","repos_url":"https://api.github.com/users/munjaldoshi/repos","events_url":"https://api.github.com/users/munjaldoshi/events{/privacy}","received_events_url":"https://api.github.com/users/munjaldoshi/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/AzureAD/rms-sdk-for-cpp/milestones/1","html_url":"https://github.com/AzureAD/rms-sdk-for-cpp/milestones/v0.2","labels_url":"https://api.github.com/repos/AzureAD/rms-sdk-for-cpp/milestones/1/labels","id":1173273,"number":1,"title":"v0.2","description":"","creator":{"login":"joshgav","id":4421720,"avatar_url":"https://avatars.githubusercontent.com/u/4421720?v=3","gravatar_id":"","url":"https://api.github.com/users/joshgav","html_url":"https://github.com/joshgav","followers_url":"https://api.github.com/users/joshgav/followers","following_url":"https://api.github.com/users/joshgav/following{/other_user}","gists_url":"https://api.github.com/users/joshgav/gists{/gist_id}","starred_url":"https://api.github.com/users/joshgav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshgav/subscriptions","organizations_url":"https://api.github.com/users/joshgav/orgs","repos_url":"https://api.github.com/users/joshgav/repos","events_url":"https://api.github.com/users/joshgav/events{/privacy}","received_events_url":"https://api.github.com/users/joshgav/received_events","type":"User","site_admin":false},"open_issues":8,"closed_issues":1,"state":"open","created_at":"2015-06-20T03:35:59Z","updated_at":"2015-06-25T18:27:15Z","due_on":"2015-06-30T07:00:00Z","closed_at":null},"comments":3,"created_at":"2015-06-24T17:06:15Z","updated_at":"2015-06-25T18:27:15Z","closed_at":"2015-06-25T18:27:15Z","body":"From @Kammy6679 \r\n\r\nWe are using a custom (ad hoc) policy to protect a file and set policy name and description. At unprotection time, the policy name and description are changed to “Restricted Access” and “Permission is currently restricted. Only specified users can access this content.”\r\n\r\nHere is our code.\r\n\r\n```\r\nbool CMSDataInteractionLinux::InitMSProtectedDataWithFilePath(FS_LPCWSTR lpwsFilePath)\r\n{\r\n    m_qsfilePath = QString::fromWCharArray((wchar_t *)lpwsFilePath);\r\n    QString qsUser;\r\n    theApp.GetLoggingAccessToken(qsUser);\r\n    m_orgFile.setFileName(m_qsfilePath);\r\n    if (!m_orgFile.open(QIODevice::ReadOnly))\r\n    {\r\n        return false;\r\n    }\r\n    m_bNeedCloseOrgFile = true;\r\n\r\n    QSharedPointer<QDataStream> orgFileStream = QSharedPointer<QDataStream>::create(&m_orgFile);\r\n    SharedStream orgIStream = QTStreamImpl::Create(orgFileStream);\r\n    std::string userId = qsUser.toStdString();\r\n    addCertificates();\r\n    m_protectedFileStreamResult = ProtectedFileStream::Acquire(orgIStream,\r\n                                                 userId,\r\n                                                 m_authenticationCallback,\r\n                                                 m_consentCallback,\r\n                                                 POL_None);\r\n\r\n    if ((m_protectedFileStreamResult.get() != nullptr) &&\r\n        (m_protectedFileStreamResult->m_status == Success) &&\r\n        (m_protectedFileStreamResult->m_stream != nullptr))\r\n    {\r\n        bool bCanRead = m_protectedFileStreamResult->m_stream->CanRead();\r\n        if (!bCanRead)\r\n            return false;\r\n        m_dwDocSize = m_protectedFileStreamResult->m_stream->Size();\r\n        m_bCusProtectedFile = false;\r\n        m_pUserPolicy = m_protectedFileStreamResult->m_stream->Policy();\r\n        return true;\r\n    }\r\n\r\n    return false;\r\n}\r\n```"}}