There are easier ways to distribute a certificate to your students... have you explored possibilities there? Seems to me that you're trying to solve something with restrict access, that can be solved by any of the following plugins: https://moodle.org/plugins/?q=certificate
Teaching with Moodle
Folders restricted by MoodleID (Not Profile ID)
This discussion has been locked so you can no longer reply to it.