changed _getEndJs() function to check if the logged user role is the
same as the permission of the different parts of the page