Which code segment should you implement in the Web Part?

You need to create a Web Part that creates a copy of the out-of-the-box Contribute permission level.

Which code segment should you implement in the Web Part?

You need to create a Web Part that creates a copy of the out-of-the-box Contribute permission level.

Which code segment should you implement in the Web Part?

A.
SPRoleDefinition myRole = new SPRoleDefinition();
myRole.Name = “Contribute”;
SPContext.Current.Web.RoleDefinitions.Add(myRole);

B.
SPRoleDefinition myRole = new SPRoleDefinition(SPContext.Current.Web.RoleDefinitions[“Contribute”]);
myRole.Name = “MyContribute”;
SPContext.Current.Web.RoleDefinitions.Add(myRole);

C.
SPRoleDefinition myRole = new SPRoleDefinition(SPContext.Current.Web.RoleDefinitions[“MyContribute”]);
myRole.Description = “Contribute”;
SPContext.Current.Web.RoleDefinitions.Add(myRole);

D.
SPRoleDefinition myRole = new SPRoleDefinition(SPContext.Current.Web.RoleDefinitions[“MyContribute”]);
myRole.Name = “Contribute”;
SPContext.Current.Web.RoleDefinitions.Add(myRole);

Explanation:
MNEMONIC RULE: “RoleDefinitions(“Contribute”)”



Leave a Reply 0

Your email address will not be published. Required fields are marked *