I'm facing a site collection where both role assignment ("permissions") inheritance and role definition ("permission levels") inheritance has been broken.
The role assignment inheritance can be broken with SPWeb.BreakRoleInheritance. The role definition inheritance can be broken with SPRoleDefinitionCollection.BreakInheritance (via SPWeb.RoleDefinitions.BreakInheritance).
Inherited role assignments AND role definitions can be restored with SPWeb.ResetRoleInheritance (i.e. all unique assignments and definitions are discarded - this is actually what happens when you click "Inherit Permission Levels from Parent Web Site" link under Permission Levels).
How do I restore just the inherited role definition behaviour and keep the unique role assigments?