created function and added notes to permissions checking functionality