Back port the changes from #5560
Apply the access restrictions in the front end only (see #5603)