[hooks/security] Optimize attributes permission check. [applied]