josmith
josmith

Reputation: 1049

Give not logged in users a role as 'Guest'

I am new to the framework cakephp and I am using the Authentication component as well as the ACL. I have followed this tutorial: http://book.cakephp.org/2.0/en/tutorials-and-examples/simple-acl-controlled-application/simple-acl-controlled-application.html to get me started.

How do I give a not logged in User a role (group) ACL such as 'Guest'?

Should I even consider giving a not logged in user such a role (group) ACL? I mean would it bring any disadvantages?

Upvotes: 1

Views: 686

Answers (1)

devnull
devnull

Reputation: 98

Usually you would not give a role to a user that is not logged in, because the user would not have a record in the user table therefore the User could not belongTo a Role. If you wanted to do alot of special programming I guess you could do it, but I don't see a point.

Most people just allow non-authenticated and authenticated users access to various parts of there app with the $this->Auth->allow() parameter in the controller. Then they section off other parts of the application to allow certain authenticated Users belonging to certain Roles to access with ACL.

http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html#making-actions-public

Upvotes: 1

Related Questions