sources from Ferris commit
use template for unauthorized access