User can add new document without permission through search link

Hi there hope everyone is doing greate just while doing the test i saw a bug or validation error that if a user does not have access to a document he can create a new document through the link he can see all the fields and fill but cannot save how can we solve thsi issue