So I think I got this working as intended. I added the following to
all my controllers to allow public access:
function beforeFilter() {
parent::beforeFilter();
$this->Auth->allowedActions = array('*');
}// end beforeFilter()
Now I can just use the Auth component to show only certain things on a
page. But I must admit, Im scratching my head and laughing at myself
wondering if due to what Im trying to do, if creating an ACL was what
I really needed in the first place. Good news is I definitely learned
a crap load and a bunch of details about cake came clear while
building this.
Anyhow, since I got the ACL working I figure Ill keep it but can
anyone please tell me if what Ive done above (adding the beforeFilter
function to all controllers) is a good or at least reasonable solution
for what Im trying to do or is this something I should not be doing
since its, well kinda defeating the purpose of an ACL.
Thanks!
justclint
On Dec 26, 2:42 pm, justclint <[email protected]> wrote:
> Well first off, I friggin love cake. I finally got my ACL up and
> running last night. So now I'm implementing it over to my already
> built site and everything is working well. I am having a little issue
> though and I believe it has to do with this code in my app controller.
>
> function beforeFilter() {
> //Configure AuthComponent
> $this->Auth->actionPath = 'controllers/';
> $this->Auth->authorize = 'actions';
> $this->Auth->loginAction = array('controller' => 'users',
> 'action'
> => 'login');
> $this->Auth->logoutRedirect = array('controller' => 'users',
> 'action' => 'login');
> $this->Auth->loginRedirect = array('controller' => 'posts',
> 'action'
> => 'add');
> $this->Auth->allowedActions = array('display', 'index');
> }// end beforeFilter
>
> I'm trying to figure out how I declare what is public. Per code above
> the actionPath is all controllers so controllers are on lockdown and
> we allow users based on actions and then by default any actions
> "display or index" can be viewed.
>
> For my site the whole site is public. The ACL comes in based on
> membership. So lets say you are a member you would still be accessing
> public pages like products for example but since you are a logged in
> member you would see a cheaper price for the product. The only section
> per say that I can think of that I want to be totally on lockdown is
> the users account page. In future I may add sections specifically for
> them but I dont have dedicated areas just yet for members.
>
> So basically to refine my question, how do I seperate public and
> private access without declaring every single public action in $this-
>
> >Auth->allowedActions = array('display', 'index');
>
> Oh and one other question that Ive been trying to figure out. Is it
> possible to put subfolders in the controllers forlders or is it
> something you should not do or maybe can do based on certain
> scenarios.
>
> Thanks!!!
>
> justclint
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---