Enabling/Disabling Vizit Pro & Essential for Certain Users

By deploying a custom UserProductSettings profile, you can enable or disable access to Vizit Pro & Essential for specific users and groups of users. This is different from Vizit DRM--the DRM feature redirects users and groups of users to prevent them from downloading/printing documents. UserProductSettings allows you to govern which users can access Vizit, as by default Vizit is enabled on a farm-wide basis.

Getting Started

If you haven't already, take a look at this article and follow the instructions in it to get started writing your custom code: http://support.vizit.com/entries/52705159-Getting-Started-With-Vizit-APIs


The rest of this article will explain the details of how to write the specific code for enabling/disabling features for certain users.

The Basics

Vizit 6.0 contains a new assembly named Vizit.API.Interfaces. For custom access profiles, you must implement the IUserProductSettings interface which contains three methods. The basic structure looks like this:

public bool EssentialEnabled
{
get { throw new NotImplementedException(); }
}
public bool ProEnabled
{
get { throw new NotImplementedException(); }
}
public string Id
{
get { throw new NotImplementedException(); }
}

Implementing the IUserProductSettings Interface

The following is an example IUserProductSettings implementation which causes users who are in the group "NoPro" to not have access to Vizit Pro. It also specifies that users in the group "EssentialOnly" do have access to Vizit Essential. This code is written in C# but you can also use VB.net if desired.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Vizit.API.Interfaces.Plugins;
using Microsoft.SharePoint;

namespace UserProductSettings
{
public class CustomUserProductSettings: IUserProductSettings
{
public bool EssentialEnabled
{
get
{
try
{
return SPContext.Current.Web.Groups["EssentialOnly"].ContainsCurrentUser;
}
catch
{
return false;
}
}
}
public bool ProEnabled
{
get
{
try
{
return !SPContext.Current.Web.Groups["NoPro"].ContainsCurrentUser;
}
catch
{
return true;
}
}
}
public string Id
{
get { return "YourUniqueIDHere"; }
}
}
}
Have more questions? Submit a request

0 Comments

Article is closed for comments.
Powered by Zendesk