Restricting Direct Access to Entities at Specific Times Without Using Card Views

Hello,
I would like to restrict direct access to certain entities (e.g., lights, switches, scripts) for specific users during certain times of the day without relying on card visibility tricks (Lovelace views).

For example, from 10 PM to 6 AM, I want an entity to be non-interactive or inaccessible for certain users.
I don’t want to just hide the entity from dashboards; I need it to be effectively disabled or restricted.

Is there any way to achieve this natively in Home Assistant or through automation, templates, or custom add-ons? If not, what are the best workarounds?