It is written in Lightning documentation that programmer must be enforce Sharing and CRUD/FLS rules manually. But when user go to detail-page in Napili Community user get Invalid Page when record isn't shared for him.
How can i disable this option?
If you are using a drill-down to navigate to the detail page, I don't think there is a way to disable the hyperlinks dynamically, you need to handle the CRUD/FLS in the list view / parent component where the record is displayed a.k.a hide the record when user don't have access. However, if you must display the record in the parent component, you should create a custom lightning component that displays valid message / record details based on user's FLS. Update your detail record layout to use this custom component.