DocumentViewerDeniedPermissions Property

Gets or sets a value that specifies the denied permissions for the document viewer. The default is None.

DeniedPermissions take precedence over AllowedPermissions. For instance, when AllowedPermissions is set to All and DeniedPermissions is set to Download and Print, all permissions except Download and Print will be allowed.

When combining permissions, they should be separated by comma in string and by bitwise 'or' operator in code (| in C# and OR in VB).

Definition

Namespace: GleamTech.DocumentUltimate.AspNet.UI
Assembly: GleamTech.DocumentUltimate (in GleamTech.DocumentUltimate.dll) Version: 7.2.0
C#
public DocumentViewerPermissions DeniedPermissions { get; set; }

Property Value

DocumentViewerPermissions

Example

Setting document viewer permissions in code:

C#
//allow all set of permissions (default value)
documentViewer.AllowedPermissions = DocumentViewerPermissions.All;

//allow only Download and Print permissions
documentViewer.AllowedPermissions = DocumentViewerPermissions.Download | DocumentViewerPermissions.Print;

//allow all except Download and Print permissions
documentViewer.AllowedPermissions = DocumentViewerPermissions.All;
documentViewer.DeniedPermissions = DocumentViewerPermissions.Download | DocumentViewerPermissions.Print;

//allow all set of permissions and also add OpenLocalPdf which is not included in all
documentViewer.AllowedPermissions = DocumentViewerPermissions.All | DocumentViewerPermissions.OpenLocalPdf;

Setting document viewer permissions in ASPX markup:

ASPX
<%-- allow all set of permissions (default value) --%>
<GleamTech:DocumentViewerControl runat="server" 
    Width="800" 
    Height="600" 
    Document="~/Documents/Document.docx"
    AllowedPermissions="All" />

<%-- allow only Download and Print permissions --%>
<GleamTech:DocumentViewerControl runat="server" 
    Width="800" 
    Height="600" 
    Document="~/Documents/Document.docx"
    AllowedPermissions="Download, Print" />

<%-- allow all except Download and Print permissions --%>
<GleamTech:DocumentViewerControl runat="server" 
    Width="800" 
    Height="600" 
    Document="~/Documents/Document.docx"
    AllowedPermissions="All"
    DeniedPermissions="Download, Print" />

See Also