Sep 2 2008 at 7:43 AM
Edited Sep 2 2008 at 7:55 AM
|
I wrote a little "spike" program to try to figure out why the patch doesn't seem to be working, but it's left me more confused than before.
First of all I used the "IsInRole" code snippet from the SlkApi.cs file in the 1.3.1RC1 release. As mentioned above, this somehow doesn't trap the error, but Jay's (binary) update did. I managed to get my version of it to trap the error by changing the appropriate
lines of code to read as follows:
try{
//In some cases this fails and we must take an alternate approach.
roleDefinitionCollection = spWeb.AllRolesForCurrentUser;
}
catch(Exception ex) {
if (!ex.Message.EndsWith("0x80040E14")) // Not the specific case we're looking for, rethrow
throw;
...
In other words, I took out the bit that was looking for a certain type of exception and replaced it with a normal System.Exception and changed the test to just check the end of the exception message.
Anyway, this trapped the error and my test app called this routine thus:-
foreach
(SPWeb myWeb
in checkedWebs) {
if (!myWeb.EffectivePresenceEnabled) {MessageBox.Show("Effective
presence NOT implemented on this site"); }
if (IsInRole(myWeb,
"SLK Instructor")) {
MessageBox.Show("Yes, you seem to be an instructor");
}
else {
MessageBox.Show("No, you do not appear to be an instructotr");
}
}
And that returned the message "Yes, you seem to be an instructor".
So - that works, but I still get the error when I try to allocate training material to users (with the error message in my last post above). So - could the error be elsewhere now? Any ideas?
|