Corrected secure_permission hooks