How to disable Jenkins CLI

Hey all,

I have been trying to disble Jenkins CLI and came across a solution (SECURITY-3314-3315/disable-cli.groovy at c03dab221a7359ef2d28e76b1e945145deb607bf · jenkinsci-cert/SECURITY-3314-3315 · GitHub).
But this solution is showing extra errors which are red flags for our usage.

Is there any other way to disable Jenkins CLI instead of using groovy.

Thanks in advance,
Harsha