Allow access some actions, not all actions in controller

Hello everyone,
Can you help me.

I need a simple way to deny access to one or more actions in a
controller. I’m using Auth (no ACL), but on a certain date, I want to
deny access to a number of actions in one of my controllers. This
doesn’t have to be scripted or anything; I don’t mind flipping a
bit in the controller.
I guess I could use the ACL component, but it might be overkill as I
don’t really have any other use for it.

Thank you very much!

Hi

If you’re using Auth then you must have granted access to your actions using something like $this->Auth->allow([‘view’, ‘index’]);

You can either remove actions from that or you can use $this->Auth->deny(‘view’);

1 Like