{"record":{"id":"d015baa7a7c2154d","repo":"dotnet/wpf","slug":"sr-rmproviderexceptionnotownerofdocument","errorCode":null,"errorMessage":"SR.RMProviderExceptionNotOwnerOfDocument","messagePattern":"SR\\.RMProviderExceptionNotOwnerOfDocument","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Microsoft.DotNet.Wpf/src/PresentationUI/MS/Internal/Documents/RightsManagementManager.cs","lineNumber":426,"sourceCode":"        /// </summary>\n        internal void ShowPublishing()\n        {\n            if (!ChooseCredentials(false))\n            {\n                // If there are no credentials, and we can't select any, we\n                // should just bail out.  If there was an error somewhere\n                // during choosing credentials, an explanatory message box\n                // should already have been shown.\n                return;\n            }\n\n            if (_rmProvider.IsProtected)\n            {\n                RightsManagementLicense license = GetUseLicense();\n                if (license == null ||\n                    !(license.HasPermission(RightsManagementPermissions.AllowOwner)))\n                {\n                    throw new InvalidOperationException(\n                        SR.RMProviderExceptionNotOwnerOfDocument);\n                }\n            }\n\n            IDictionary<RightsManagementUser, RightsManagementLicense> allRights = null;\n            if (_rmProvider.IsProtected)\n            {\n                allRights = _rmProvider.GetAllAccessRights();\n            }\n\n            // Create the publishing dialog outside of the while loop so that it is only\n            // constructed once, rather than on each loop.\n            RMPublishingDialog rmPublish = null;\n            bool statusChanged = false;\n\n            try\n            {\n                rmPublish =","sourceCodeStart":408,"sourceCodeEnd":444,"githubUrl":"https://github.com/dotnet/wpf/blob/81131a70a4c573cd62748a5c36908fc4d662daa9/src/Microsoft.DotNet.Wpf/src/PresentationUI/MS/Internal/Documents/RightsManagementManager.cs#L408-L444","documentation":"Thrown by RightsManagementManager.ShowPublishing (invoked from ShowPermissions) when the document is rights-protected but the current user's use license does not grant AllowOwner. Republishing (editing permissions) of a protected document is reserved for owners, so the publishing UI refuses to open.","triggerScenarios":"Calling ShowPermissions/ShowPublishing on a protected document while logged in as a non-owner whose use license lacks RightsManagementPermissions.AllowOwner.","commonSituations":"End user tries to edit permissions of a document published by someone else; app runs under a different account than the one that protected the document; RM license was acquired for read-only rights.","solutions":["Run the publishing/permissions flow under the account that owns the document (has AllowOwner)","Have an owner re-publish the document granting Owner rights to the intended user","Check the acquired use license actually grants AllowOwner before opening the dialog","Publish a new document with the desired permissions instead of republishing the protected one"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"var license = GetUseLicense();\nif (license == null || !license.HasPermission(RightsManagementPermissions.AllowOwner))\n    throw new InvalidOperationException(\"Owner rights required to edit permissions.\");","typeGuard":"bool IsOwner(RightsManagementLicense l) => l != null && l.HasPermission(RightsManagementPermissions.AllowOwner);","tryCatchPattern":"try { ShowPermissions(); }\ncatch (InvalidOperationException) { /* inform user only owners can edit permissions */ }","preventionTips":["Only expose the publishing UI to owner accounts","Cache owner status with the license and gate UI commands on it","Verify AllowOwner permission before any republish flow"],"tags":["rights-management","permissions","owner"],"backgroundTag":"permission-denied","analyzedSha":"81131a70a4c573cd62748a5c36908fc4d662daa9","analyzedAt":"2026-09-14T10:12:48.479Z","contentChangedAt":"2026-09-14T10:12:48.479Z","schemaVersion":2},"datasetVersion":"2026-09-21T21:30:21.729Z"}