I’m using CakePHP’s Auth component and I’m wondering whats the best way to allow the user to decide whether or not they give public access to their own page, ie. /user/username/public. So i’d have a checkbox in their profile page and save a 1 or a 0 in the DB for a “Public” field. However, whats the best way to allow the Auth component to conditionally allow access to this page?
Share
That’s not really a job for the Auth component, but for custom code.
You could use an
isAuthenticatedcallback, but passing around the condition would become somewhat messy. The Auth component is handling general authentication, this case is too specialized to cleanly handle it using Auth.