Hi there,
I'm after functionality 'like facebook' (that must be a common phrase)
I.e. when User A adds User B as a colleague, A is B's friend and most importantly B is A's friend
When I make a custom web part to show A and B their friends, they should both be on it.
The problem is if A requests B's friendship, B accepts and I forge a colleague link between B and A - that's fine, B can see A as a colleague
But, how can I tell from A that B is a colleague? ColleagueManager.IsColleague() returns true e.g. A.Colleagues.IsColleague(B) == true but B is not in A's Colleagues list (assuming two people only, A.Colleagues.GetItems().Length == 0)
The solution i've come up with is once B has accepted the 'friend request' in my own custom acceptance system, I create a UserProfile object for A and attempt to forge the link back (code below) - this however causes an UnauthorizedAccessException on the
penultimate line - what am i doing wrong? Have i missed some vital part of the colleagues system?
All help appreciated!
if (not already colleagues):
SPSecurity.RunWithElevatedPrivileges(delegate()
{
// Add the colleague relationship
&
View Complete Post