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).
public DocumentViewerPermissions DeniedPermissions { get; set; }
Public Property DeniedPermissions As DocumentViewerPermissions
Get
Set
Setting document viewer permissions in code:
//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;
'allow all set of permissions (default value)
documentViewer.AllowedPermissions = DocumentViewerPermissions.All
'allow only Download and Print permissions
documentViewer.AllowedPermissions = DocumentViewerPermissions.Download Or DocumentViewerPermissions.Print
'allow all except Download and Print permissions
documentViewer.AllowedPermissions = DocumentViewerPermissions.All
documentViewer.DeniedPermissions = DocumentViewerPermissions.Download Or DocumentViewerPermissions.Print
'allow all set of permissions and also add OpenLocalPdf which is not included in all
documentViewer.AllowedPermissions = DocumentViewerPermissions.All Or DocumentViewerPermissions.OpenLocalPdf
Setting document viewer permissions in ASPX markup:
<%-- 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" />