Discussing the nuts and bolts of software development

Wednesday, July 09, 2008


Trouble Getting Your Custom Protector Called?

You might be getting a lot of grey hair by developing your own custom protector for SharePoint. Until recently, I was right there with you. Having troubles getting your custom protector to be called by SharePoint? I'm here to help. I'm happy to tell you that it could be a simple fix. A simple flag as a matter of fact. If you haven't heard of the IrmAddInsEnabled flag, then this is what you must do.

You need to set the IrmAddInsEnabled flag to true in the Central Admin page to get SharePoint to call any of the protector function calls (HrIsProtected, HrProtect, HrUnprotect). This sets a Boolean value that specifies whether to enable Information Rights Management (IRM) addins.

You can do this directly on the MOSS server from the 12 Hive (C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\BIN) by calling the following:

On the MOSS server:

'stsadm -o setproperty -propertyname irmaddinsenabled -propertyvalue "yes"'

Alternatively, you can do this programmatically by using SharePoint via the IRM Settings by using SPIrmSettings.IrmAddins. This can be done at the farm level or as granular as a per-list basis.

IRM Settings for the FARM:

SPWebService svc = SPFarm.Local.Services.GetValue();
SPIrmSettings irmSettings = svc.IrmSettings;

//Specifies whether to enable Information Rights Management (IRM)
//locally for sites
irmSettings.IrmRMSEnabled = true;

//Specifies whether to enable Information Rights Management (IRM)
irmSettings.IrmAddinsEnabled = true;

//Sets the number of times the Information Rights Management (IRM)
//settings have been changed
irmSettings.IrmChanges += 2;


IRM Settings for the Individual Lists on FeatureActivated:

SPWeb web = (SPWeb)properties.Feature.Parent;
foreach (SPList list in web.Lists)
// Specifies whether to enable Information Rights Management (IRM)
// for the list
list.IrmEnabled = true;

// Specifies whether to allow users to upload documents that do
// not support IRM
list.IrmReject = true;


After you have done this, your custom protector should be called when the documents are checked in and out of your SharePoint system via the HrIsProtected, HrProtect, HrUnprotect methods.


Labels: , ,

You can read these useful advices if you want to know if SAT score is important. It's quite important to know if you want to achieve success.

How do you clean a fabric sofa?

How much does it cost to have a sofa cleaned?

How do you clean a sofa?

Can you get a couch professionally cleaned?

شركة تنظيف كنب بمكة بالبخار

شركة تنظيف كنب بمكة بالبخار

Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?