logo       

Re: ACL dilemma: msg#00009

Subject: Re: ACL dilemma
Thank you very much. The database part is now clear and I map the relevant
tables (users and User_to_Group) in the model section of the application. I
would appreciate any help on setting up the ACL class to use the table
models. 

-Maru




Nikos Dimopoulos wrote:
> 
> For starters apologies for the double post earlier. For some reason my
> client reported that I didn't post it.
> 
> I am thinking of the following:
> 
> Users table:
> user_id
> user_login
> user_password
> user_fullname
> user_address
> user_city
> user_state
> (and more fields if you need to)
> 
> Groups table
> group_id
> group_name
> 
> User_to_Group table
> user_id
> group_id
> 
> In Users table you have say the following:
> user_id = 1
> user_login = administrator
> user_password = 12345
> ......
> 
> user_id = 2
> user_login = someuser
> user_password = somepassword
> .....
> 
> Groups table :
> group_id = 1
> group_name = Administrators
> 
> group_id = 2
> group_id = Users
> 
> User_to_Group table
> user_id  = 1 // admin
> group_id = 1 // admin
> 
> user_id = 1 // admin
> group_id = 2 // users group
> 
> user_id = 2 // someuser
> group_id = 2 // users
> 
> The above represents your database model. You can easily map that with
> relevant classes in your model and load the ACL accordingly.
> 
> As for the permissions idea that I mentioned earlier I will post something
> relevant shortly.
> 
> Nikos.
> 
> 
> 
> 
> On 11/5/07, mmaru <mulugetamaru-Re5JQEeQqe8AvxtiuMwx3w@xxxxxxxxxxxxxxxx> 
> wrote:
>>
>>
>> Thank you Nikos. The reason I wanted to create the three tables is to
>> check
>> whether a user belongs to a particular group.
>>
>> Is there an example or tutorial that I can use to implement the above
>> requirement?
>>
>> Your help is very much appreciated.
>>
>> Maru
>>
>>
>>
>> Nikos Dimopoulos wrote:
>> >
>> > I agree with Michael. This is the best way to go forward. The users
>> > table contains the users, the groups the groups and the user_to_group
>> > contains the numeric ids of the other two tables.
>> >
>> > Additionally for the ACL what you could do is create a table say
>> > 'permissions'. Then you enter all the available permissions there (i.e.
>> > forum read, forum write, forum edit - with 1/0 as yes/no). The last
>> > thing you can do is have a table that will bind permission to group and
>> > you can load that table to the ACL to give permissions to your users.
>> >
>> > Just some random thoughts.
>> >
>> > Best regards,
>> >
>> > Nikos
>> >
>> >
>> > Michael B Allen wrote:
>> >> On 11/5/07, mmaru <mulugetamaru-Re5JQEeQqe8AvxtiuMwx3w@xxxxxxxxxxxxxxxx> 
>> >> wrote:
>> >>
>> >>> Since one user may belong to one or more group and one group my have
>> one
>> >>> or
>> >>> more users. What I suggested may not work. Instead it we would have 3
>> >>> tables:
>> >>>
>> >>> 1. Users
>> >>> 2. Group
>> >>> 3. Users_Group.
>> >>>
>> >>
>> >> Hi Maru,
>> >>
>> >> I haven't looked at Zend_Acl yet but the way group membership is
>> >> stored in a DB is usually with a "members" table that consists of only
>> >> two integer fields - one for the ids of groups and one for the ids of
>> >> users. If you want to find the groups someone is in you do SELECT gid
>> >> FROM members WHERE uid == $uid. If you want to find the users that are
>> >> in a group you do SELECT uid FROM members WHERE gid = $gid.
>> >>
>> >> Mike
>> >>
>> >>
>> >
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/ACL-dilemma-tf4755245s16154.html#a13600148
>> Sent from the Zend Auth mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> The contents of this message may contain confidential or privileged
> information and is intended solely for the recipient(s). Use or
> distribution
> to and by any other party is not authorized. If you are not the intended
> recipient, copying, distribution or use of the contents of this
> information
> is prohibited.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/ACL-dilemma-tf4755245s16154.html#a13600519
Sent from the Zend Auth mailing list archive at Nabble.com.




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
audio.irate.dev...    yellowdog.gener...    ietf.ips/2002-0...    xfree86.fonts/2...    busybox/2003-07...    emacs.jdee/2004...    linux.mandrake....    hardware.microc...    user-groups.lin...    science.analysi...    version-control...    db.filemaker.de...    cluster.openmos...    mail.eyebrowse....    text.xml.xerces...    kde.devel.kwrit...    finance.moneyda...    gcc.regression/...    network.routing...    os.freebsd.deve...    recreation.radi...    qnx.openqnx.dev...    python.xml/2002...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe