1

There are two constructors for the SPRoleAssignment class:

public SPRoleAssignment(SPPrincipal principal)
public SPRoleAssignment(string LoginName, string Email, string Name, string Notes)

The definition of the Notes parameter is following (from MSDN):

The notes for the user.

In Visual Studio (2013), IntelliSense gives me following definition:

Notes: String that contains notes for the user.

But nowhere I can find more information regarding the purpose of this parameter. After initializing the class, I cannot find a property Notes on the object. Then I thought it might be in the Member property of the object, since the parameters LoginName and Name are properties of the SPPrincipal class. But also there, nothing about a Notes property.

I went looking on MSDN and several questions here on SharePoint.SE or StackOverflow but everywhere the parameter is just filled in with "Notes".

Hence my question: what is the purpose of this parameter? And how can I get the value after initialization?

1 Answer 1

1

After further investigating I found that Notes is a property of the SPUser class. Thus, following would work:

var spRole = new SPRoleAssignment("domain\\name", "[email protected]", "name", "notes for user");
var spUser = (SPUser)spRole.Member;
var notes = spUser.Notes;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.