Zendcasts Forum

A community of developers who work with the Zend Framework and other enterprise PHP technologies

You are not logged in.

#1 2010-03-16 19:12:34

miika
Member
From: Finland
Registered: 2010-03-03
Posts: 10

Creating ACL

Hello,

I need to develop ACL system to my project. Now I'm wondering that what are those resources? Do I simply put every url into database? I mean that if I have url like http://www.example.com/draft/index/show/id/1, should I put that url (/draft/index/show/id/1) into database or what? Or should I put only url to the action (/draft/index/show) to the database and then in code find out if the currently logged in user owns the resource?

Any suggestions how to do this properly?

Offline

#2 2010-03-17 09:56:12

smriti
Member
From: India , Calcutta
Registered: 2009-12-14
Posts: 13

Re: Creating ACL

I think you are trying to give user privilege  on the basis of login parameters.
If it is then you have to store your path in database and also have to assemble in proper url format. It can be easily developed.

Demo--

1. Store all the modules name in table1 ( if you are using modular structure )

2. Store all the controllers name in  table2 and map it to module using additional column [ Example - MODULE_ID ]

3. Store all the actions name in table3 and map it to controller using  additional column [ Example - CONTROLLER_ID ]

4. Make additional table to give user privilege [ Example - User1 => Module_1  , This means 'Module_1' is accessible by 'User1'  ]

So you stored all the resources in database part by part.
Now on the basis of your condition assemble the path ( ex- /Module_Name/Controller_Name/Action_Name ) and give a role

Hope these will help you -- smile

Offline

Board footer

Powered by FluxBB