dotnet/wpf · error · InvalidOperationException
SR.RMProviderExceptionNotOwnerOfDocument
Error message
SR.RMProviderExceptionNotOwnerOfDocument
What it means
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.
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
Defensive patterns
Strategy: validation
Validate before calling
var license = GetUseLicense();
if (license == null || !license.HasPermission(RightsManagementPermissions.AllowOwner))
throw new InvalidOperationException("Owner rights required to edit permissions."); Type guard
bool IsOwner(RightsManagementLicense l) => l != null && l.HasPermission(RightsManagementPermissions.AllowOwner);
Try / catch
try { ShowPermissions(); }
catch (InvalidOperationException) { /* inform user only owners can edit permissions */ } Prevention
- 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
When it happens
Trigger: Calling ShowPermissions/ShowPublishing on a protected document while logged in as a non-owner whose use license lacks RightsManagementPermissions.AllowOwner.
Common situations: 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.
Understand the failure class
Background: Permission denied / not authorized / 403 Forbidden: access-control rejections when the caller lacks the required role, grant, or ownership — this error's family across 18 libraries.
Related errors
- SR.RMProviderExceptionNotOwnerOfDocument
- Cannot perform stream operation because CryptoProvider is…
- SR.RightsManagementExceptionNoRightsForOperation
- SR.RMProviderExceptionNoRightsToDocument
- ArgumentOutOfRangeException(authentication)
AI-assisted analysis of dotnet/wpf@81131a70a4 (2026-09-14).
Data as JSON: /api/errors/d015baa7a7c2154d.
Report an issue: GitHub.
Appendix: source
Thrown at src/Microsoft.DotNet.Wpf/src/PresentationUI/MS/Internal/Documents/RightsManagementManager.cs:426
/// </summary>
internal void ShowPublishing()
{
if (!ChooseCredentials(false))
{
// If there are no credentials, and we can't select any, we
// should just bail out. If there was an error somewhere
// during choosing credentials, an explanatory message box
// should already have been shown.
return;
}
if (_rmProvider.IsProtected)
{
RightsManagementLicense license = GetUseLicense();
if (license == null ||
!(license.HasPermission(RightsManagementPermissions.AllowOwner)))
{
throw new InvalidOperationException(
SR.RMProviderExceptionNotOwnerOfDocument);
}
}
IDictionary<RightsManagementUser, RightsManagementLicense> allRights = null;
if (_rmProvider.IsProtected)
{
allRights = _rmProvider.GetAllAccessRights();
}
// Create the publishing dialog outside of the while loop so that it is only
// constructed once, rather than on each loop.
RMPublishingDialog rmPublish = null;
bool statusChanged = false;
try
{
rmPublish =View on GitHub (pinned to 81131a70a4)