If you set the permissions for group
@all to
none, then a page can only be viewed after logging in first. On viewing a page, a not logged in user will immediately be prompted to login first (without seeing any page content). Is that what you want? Also see
https://www.dokuwiki.org/acl.