I believe this was what I remeber as the “admin bug” issue.
This is a bug in the original SLK “IsInRole” routine… I believe it was the case that if the instructor is also an administrator then
the test to check if they are an Instructor fails within the SLK and the error condition occurs…
FIX: Run the “spWeb.AllRosesForCurrentUser” with Elevated Privileges… OR – take the Instructor out of the Admin class…
bool IsInRole(SPWeb spWeb,
// Security checks: Fails if the user doesn't have Reader access (implemented
// by SharePoint)
// Check parameters
if (spWeb == null)
// Verify that the web is in the site
if (spWeb.Site.ID != m_anonymousSlkStore.SPSiteGuid)
bool isInRole = false;
SPRoleDefinitionBindingCollection roleDefinitionCollection =
//HPGMODS - Try runwithelevatedprivileges
// In some cases this fails and we must take an alternate approach. HPG - not if run with Elevated Privileges...
roleDefinitionCollection = spWeb.AllRolesForCurrentUser;