Add Custom Permission to Group
I want to add Custom Permission To group using Visual Studio 2012..please help me...
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Manesh GolekarRank #5,709 · 289 reputationPosted Sep 12, 2014, 3:11 PM EDT
This should work for You ..
SPWeb web = SPContext.Current.Web;
SPGroup group = web.SiteGroups["Group Name"];
SPRoleDefinition rDefination = web.RoleDefinitions.GetByType(SPRoleType.Reader);
SPRoleAssignment rAssignment = new SPRoleAssignment(group);
rAssignment.RoleDefinitionBindings.Add(rDefination);
Pankit Patel5 reputationPosted Sep 12, 2014, 10:20 PM EDT