Okay simple solution here: Make sure that if you are not the root SPWeb and you want to add custom role definitions i.e. SPRoleDefinitions call SPRoleDefinitionCollection.BreakInheritance(bool,bool)
if (!web.IsRootWeb && !web.HasUniqueRoleDefinitions) { web.RoleDefinitions.BreakInheritance(true, false); }
Thanks a lot… you wont beleive your code snippet has helped me a lot with just a click.