Manual:$wgEnablePartialBlocks

Details
If set to "true", it is possible to block a user account, IP address or IP range from particular pages, namespaces or actions.