Re: different types of Users
You might find prefixes useful for your solution. You can set prefixes for actions and then only allow users of that group to access those actions. That wouldn't require the ACL and might be what you're after (separation of group logic). In 1.3 you'd set different prefixes in your core.php file (admin, affiliate, member) then you'd define your actions so that only those with that access level could view them: admin_edit() ... affiliate_edit() ... member_edit() In your beforeFilter() you'd just check what action the user is attempting to use and check if they are in the right group. Something like: function beforeFilter(){ if(strpos($this->action,"admin") !== false){ return ($this->Auth->user('group') == 'admin'); } if(strpos($this->action,"affiliate") !== false){ return ($this->Auth->user('group') == 'affiliate'); } if(strpos($this->action,"member") !== false){ return ($this->Auth->user('group') == 'member'); } return false; } Just an idea. However, I would still suggest going with ACL in your case. I'm with WebbedIT -- ACL is too complex for my needs most of the time, but from your description it sounds like your system could become unwieldy without it. I'd give ACL a look-see if I were you. Hope that helps, Nick On Mar 17, 4:57 pm, cricket wrote: > Thanks, all, for the responses. I guess I should have mentioned that > I've used ACL before, for an intranet to allow a company's affiliates > log in and access many types of files. The requirement was that each > group be shown (and be able to download) only certain folders/files. I > used ACL and a tree structure (it was, essentially, a directory > structure) and a record-level protection model. After *a lot* of > frustration (my first stab at ACL), it worked very well. I should > really get around to writing an article for the Bakery, as I don't > think anyone else has published anything on doing this with Cake. > > That said, I'm leaning away from ACL for this project. The issue for > me is not so much access control but modeling different user types. > I've decided to store the model name & association_key in the users > table, which is an approach that's worked well for me in similar (non- > user) situations. Then I'll have separate Member, Affiliate, and > Administrator models. Auth will keep that info in the session, so I > can use that for access control after authentication has proceeded. > > On Mar 17, 3:33 pm, Martin Duris wrote: > > > > > one of the key to understand is to know how ACL works - tree structure > > - than its just question of time, to get everything work > > > 2010/3/17 Alejandro Gomez Fernandez : > > > > I'm new usign cake, but not designing information systems in different > > > platforms, even web. > > > I think the solution to your dilemma is using ACL. Yes, I know is at the > > > beginning difficult to understood and implement, but it was designed > > > speciffically to solve this problem. It permits you to assign differents > > > roles to any person and to change this persons' role in any moment without > > > any aditional work (more than select the roles in the ACL admin). > > > Obviously there are many other workarounds to solve your specific problem, > > > but the idea behind cake is re-usability. When you adjust an ACL (maybe at > > > the beginning almost copy and paste from any book or tutorial) you can > > > re-use it in any other project. When many more times you practice to > > > develop/implement any technic, more close you are of master it. > > > I hope this comment serves you to decide how to approach this problem. > > > > Regards, > > > > Alejandro Gomez Fernandez. > > > > El 16/03/2010 15:44, cricket escribió: > > > > I'm just starting on a site that will have several types of users and > > > am uncertain of the best approach to take. I'd like to hear from > > > others who have done something similar. > > > > The site will have the following user types: > > > > Administrators > > > Members > > > Affiliates > > > > Admins may or not be Members. Affiliates will not be Admins nor > > > Members, but the fields for Affiliates and Members are quite similar. > > > However, they may diverge further down the road. > > > > All should be able to log in, so I plan to, at least, have a users > > > table with the passwords. But I'd prefer not to have every possible > > > field stuffed in there and instead use separate models for each type. > > > This seems like a good fit for role-based authentication, using > > > Groups, but I think it would make more sense to have separate Member, > > > Affiliate, and Administrator models. > > > > But, in that case, how should I go about registering what a newly- > > > logged-in User is? One idea I had was to include "model" & > > > "association_key" fields in the users table, then loading the info as > > > needed (because it will be stored Auth's session array). > > > > So, how have others approached this? ExtendableBehavior? > > > InheritableBehavior
Re: different types of Users
Thanks, all, for the responses. I guess I should have mentioned that I've used ACL before, for an intranet to allow a company's affiliates log in and access many types of files. The requirement was that each group be shown (and be able to download) only certain folders/files. I used ACL and a tree structure (it was, essentially, a directory structure) and a record-level protection model. After *a lot* of frustration (my first stab at ACL), it worked very well. I should really get around to writing an article for the Bakery, as I don't think anyone else has published anything on doing this with Cake. That said, I'm leaning away from ACL for this project. The issue for me is not so much access control but modeling different user types. I've decided to store the model name & association_key in the users table, which is an approach that's worked well for me in similar (non- user) situations. Then I'll have separate Member, Affiliate, and Administrator models. Auth will keep that info in the session, so I can use that for access control after authentication has proceeded. On Mar 17, 3:33 pm, Martin Duris wrote: > one of the key to understand is to know how ACL works - tree structure > - than its just question of time, to get everything work > > 2010/3/17 Alejandro Gomez Fernandez : > > > I'm new usign cake, but not designing information systems in different > > platforms, even web. > > I think the solution to your dilemma is using ACL. Yes, I know is at the > > beginning difficult to understood and implement, but it was designed > > speciffically to solve this problem. It permits you to assign differents > > roles to any person and to change this persons' role in any moment without > > any aditional work (more than select the roles in the ACL admin). > > Obviously there are many other workarounds to solve your specific problem, > > but the idea behind cake is re-usability. When you adjust an ACL (maybe at > > the beginning almost copy and paste from any book or tutorial) you can > > re-use it in any other project. When many more times you practice to > > develop/implement any technic, more close you are of master it. > > I hope this comment serves you to decide how to approach this problem. > > > Regards, > > > Alejandro Gomez Fernandez. > > > El 16/03/2010 15:44, cricket escribió: > > > I'm just starting on a site that will have several types of users and > > am uncertain of the best approach to take. I'd like to hear from > > others who have done something similar. > > > The site will have the following user types: > > > Administrators > > Members > > Affiliates > > > Admins may or not be Members. Affiliates will not be Admins nor > > Members, but the fields for Affiliates and Members are quite similar. > > However, they may diverge further down the road. > > > All should be able to log in, so I plan to, at least, have a users > > table with the passwords. But I'd prefer not to have every possible > > field stuffed in there and instead use separate models for each type. > > This seems like a good fit for role-based authentication, using > > Groups, but I think it would make more sense to have separate Member, > > Affiliate, and Administrator models. > > > But, in that case, how should I go about registering what a newly- > > logged-in User is? One idea I had was to include "model" & > > "association_key" fields in the users table, then loading the info as > > needed (because it will be stored Auth's session array). > > > So, how have others approached this? ExtendableBehavior? > > InheritableBehavior? PolymorphicBehavior? Something else? > > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others > > with their CakePHP related questions. > > > You received this message because you are subscribed to the Google Groups > > "CakePHP" group. > > To post to this group, send email to cake-php@googlegroups.com > > To unsubscribe from this group, send email to > > cake-php+unsubscr...@googlegroups.com For more options, visit this group at > >http://groups.google.com/group/cake-php?hl=en > > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others > > with their CakePHP related questions. > > > You received this message because you are subscribed to the Google Groups > > "CakePHP" group. > > To post to this group, send email to cake-php@googlegroups.com > > To unsubscribe from this group, send email to > > cake-php+unsubscr...@googlegroups.com For more options, visit this group at > >http://groups.google.com/group/cake-php?hl=en > > Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: different types of Users
one of the key to understand is to know how ACL works - tree structure - than its just question of time, to get everything work 2010/3/17 Alejandro Gomez Fernandez : > I'm new usign cake, but not designing information systems in different > platforms, even web. > I think the solution to your dilemma is using ACL. Yes, I know is at the > beginning difficult to understood and implement, but it was designed > speciffically to solve this problem. It permits you to assign differents > roles to any person and to change this persons' role in any moment without > any aditional work (more than select the roles in the ACL admin). > Obviously there are many other workarounds to solve your specific problem, > but the idea behind cake is re-usability. When you adjust an ACL (maybe at > the beginning almost copy and paste from any book or tutorial) you can > re-use it in any other project. When many more times you practice to > develop/implement any technic, more close you are of master it. > I hope this comment serves you to decide how to approach this problem. > > Regards, > > > > Alejandro Gomez Fernandez. > > > > > El 16/03/2010 15:44, cricket escribió: > > I'm just starting on a site that will have several types of users and > am uncertain of the best approach to take. I'd like to hear from > others who have done something similar. > > The site will have the following user types: > > Administrators > Members > Affiliates > > Admins may or not be Members. Affiliates will not be Admins nor > Members, but the fields for Affiliates and Members are quite similar. > However, they may diverge further down the road. > > All should be able to log in, so I plan to, at least, have a users > table with the passwords. But I'd prefer not to have every possible > field stuffed in there and instead use separate models for each type. > This seems like a good fit for role-based authentication, using > Groups, but I think it would make more sense to have separate Member, > Affiliate, and Administrator models. > > But, in that case, how should I go about registering what a newly- > logged-in User is? One idea I had was to include "model" & > "association_key" fields in the users table, then loading the info as > needed (because it will be stored Auth's session array). > > So, how have others approached this? ExtendableBehavior? > InheritableBehavior? PolymorphicBehavior? Something else? > > Check out the new CakePHP Questions site http://cakeqs.org and help others > with their CakePHP related questions. > > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To post to this group, send email to cake-php@googlegroups.com > To unsubscribe from this group, send email to > cake-php+unsubscr...@googlegroups.com For more options, visit this group at > http://groups.google.com/group/cake-php?hl=en > > > Check out the new CakePHP Questions site http://cakeqs.org and help others > with their CakePHP related questions. > > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To post to this group, send email to cake-php@googlegroups.com > To unsubscribe from this group, send email to > cake-php+unsubscr...@googlegroups.com For more options, visit this group at > http://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: different types of Users
I'm new usign cake, but not designing information systems in different platforms, even web. I think the solution to your dilemma is using ACL. Yes, I know is at the beginning difficult to understood and implement, but it was designed speciffically to solve this problem. It permits you to assign differents roles to any person and to change this persons' role in any moment without any aditional work (more than select the roles in the ACL admin). Obviously there are many other workarounds to solve your specific problem, but the idea behind cake is re-usability. When you adjust an ACL (maybe at the beginning almost copy and paste from any book or tutorial) you can re-use it in any other project. When many more times you practice to develop/implement any technic, more close you are of master it. I hope this comment serves you to decide how to approach this problem. Regards, Alejandro Gomez Fernandez. El 16/03/2010 15:44, cricket escribió: > I'm just starting on a site that will have several types of users and > am uncertain of the best approach to take. I'd like to hear from > others who have done something similar. > > The site will have the following user types: > > Administrators > Members > Affiliates > > Admins may or not be Members. Affiliates will not be Admins nor > Members, but the fields for Affiliates and Members are quite similar. > However, they may diverge further down the road. > > All should be able to log in, so I plan to, at least, have a users > table with the passwords. But I'd prefer not to have every possible > field stuffed in there and instead use separate models for each type. > This seems like a good fit for role-based authentication, using > Groups, but I think it would make more sense to have separate Member, > Affiliate, and Administrator models. > > But, in that case, how should I go about registering what a newly- > logged-in User is? One idea I had was to include "model" & > "association_key" fields in the users table, then loading the info as > needed (because it will be stored Auth's session array). > > So, how have others approached this? ExtendableBehavior? > InheritableBehavior? PolymorphicBehavior? Something else? > > Check out the new CakePHP Questions site http://cakeqs.org and help others > with their CakePHP related questions. > > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To post to this group, send email to cake-php@googlegroups.com > To unsubscribe from this group, send email to > cake-php+unsubscr...@googlegroups.com For more options, visit this group at > http://groups.google.com/group/cake-php?hl=en > Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: different types of Users
First, take a look at ACL component. If you can make it work, that's what you need. (Although it's really confusing, and I don't use it for my needs). If you decide to not use ACL, you'll use Auth component (that's just being able to login; you'd use it with ACL, too), then store your user.id in a session, and do authorization based on privileges of each user (and user type). Use only one User model. In it, have several boolean columns that distinguish between user types (example below). Then, in your model do validation s.t. an admin cannot possibly be a member, when they register. Have several registration forms that only make some columns available, but use the same model. Your authorization (not to confuse with authentication) will go in beforeFilter() of AppController. example user table: create table users( `id` int(12) not null auto_increment primary key, `username` varchar(200) null, `password` varchar(60) null, `first_name` varchar(200) null, `last_name` varchar(200) null, `created` timestamp default now(), `is_admin` boolean default false, `is_member` boolean default false, `is_affiliate` boolean default false ); But, you know, as soon as you feel that the thing is getting too complex (which is likely), just go with ACL. _V On Mar 16, 1:44 pm, cricket wrote: > I'm just starting on a site that will have several types of users and > am uncertain of the best approach to take. I'd like to hear from > others who have done something similar. > > The site will have the following user types: > > Administrators > Members > Affiliates > > Admins may or not be Members. Affiliates will not be Admins nor > Members, but the fields for Affiliates and Members are quite similar. > However, they may diverge further down the road. > > All should be able to log in, so I plan to, at least, have a users > table with the passwords. But I'd prefer not to have every possible > field stuffed in there and instead use separate models for each type. > This seems like a good fit for role-based authentication, using > Groups, but I think it would make more sense to have separate Member, > Affiliate, and Administrator models. > > But, in that case, how should I go about registering what a newly- > logged-in User is? One idea I had was to include "model" & > "association_key" fields in the users table, then loading the info as > needed (because it will be stored Auth's session array). > > So, how have others approached this? ExtendableBehavior? > InheritableBehavior? PolymorphicBehavior? Something else? Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: different types of Users
Using ACL can be very confusing, but it also can be usied to create simple accesing rules - you have 3 groups (maybe 4 when couting even visitors - ACL should work fine with that - its just point of view) but i didnt understand completly your problem - you vae problem with that, you dont know what newly registered user should be ??? or you have complet user managment dilema ? Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: different types of Users
My site has Site Manager, Site Admin, Organisation Manager, Organisation Admin, Member and I manage them using a UserGroup model. I then use Auth and set IsAuthorize methods in my controllers to determine who can and can't do what. I found ACL to complex for my needs. HTH Paul Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
different types of Users
I'm just starting on a site that will have several types of users and am uncertain of the best approach to take. I'd like to hear from others who have done something similar. The site will have the following user types: Administrators Members Affiliates Admins may or not be Members. Affiliates will not be Admins nor Members, but the fields for Affiliates and Members are quite similar. However, they may diverge further down the road. All should be able to log in, so I plan to, at least, have a users table with the passwords. But I'd prefer not to have every possible field stuffed in there and instead use separate models for each type. This seems like a good fit for role-based authentication, using Groups, but I think it would make more sense to have separate Member, Affiliate, and Administrator models. But, in that case, how should I go about registering what a newly- logged-in User is? One idea I had was to include "model" & "association_key" fields in the users table, then loading the info as needed (because it will be stored Auth's session array). So, how have others approached this? ExtendableBehavior? InheritableBehavior? PolymorphicBehavior? Something else? Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Different types of users
I am trying to build an application similar to a customer-supplier relationship. I am having a problem figuring out how to model this relationship to differentiate between the types of users. For example, people who use my application will include: Administrators Managers Customers Suppliers ... which are the entries in my Groups table. All users share some information, such as contact info, which I figured should be stored in the Users table. However, suppliers have some information that others do not such as Insurance Provider and Policy Number, and therefore should not be included in the Users table. My current setup is like so. create table groups ( id int not null auto_increment primary key, name varchar(100) not null unique ); create table users ( id int not null auto_increment primary key, group_id int not null, email varchar(255) not null unique, password varchar(255) not null ); create table suppliers ( id int not null auto_increment primary key, user_id int not null, ins_provider varchar(255) not null, policy_number varchar(100) not null ); This does not seem correct, because it allows all users to be associated with suppliers. Administrators, for instance, do not have an ins_provider or policy. This seems like it should be a fairly simple solution, but I can't seem to figure it out. Please do not just reference some page in the Cookbook without explanation, because I have read that about 100 times, and still cannot figure this out. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Different types of users
Any ideas? How can I relate othauth component with managers, clients and suppliers tables that contains all users? On 24 mar, 14:18, dandreta <[EMAIL PROTECTED]> wrote: > I am searching and reading enough things on the users' access and > permissions (OthAuth, ACL ...) and finally I have applied the othauth > component. > > The question is that I want to do the access to my application > depending on the type of user. I have 3 types of users:manager, > client, supplier and in the database 3 tables with > their different information(I have 3 separate tables because each type > of user has different information fields). I have a screen of login > with fields > password and user. I want that logging someone, depending on the type > of user who is, jumps to a different screen with his corresponding > layout and home page. How can I configure the component to apply this? > Do you know any link or anything where is explained what I want to do? > Thanks and regard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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 -~--~~~~--~~--~--~---
Different types of users
I am searching and reading enough things on the users' access and permissions (OthAuth, ACL ...) and finally I have applied the othauth component. The question is that I want to do the access to my application depending on the type of user. I have 3 types of users:manager, client, supplier and in the database 3 tables with their different information(I have 3 separate tables because each type of user has different information fields). I have a screen of login with fields password and user. I want that logging someone, depending on the type of user who is, jumps to a different screen with his corresponding layout and home page. How can I configure the component to apply this? Do you know any link or anything where is explained what I want to do? Thanks and regards --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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 -~--~~~~--~~--~--~---
Re: Login of different types of users
On Dec 20, 2007 8:55 AM, dandreta <[EMAIL PROTECTED]> wrote: > > Hi!! > I am searching and reading enough things on the users' access and > permissions (OthAuth, ACL ...). The question is that I want to do the > access to my application depending on the type of user. I have 3 types > of users:manager, client, supplier and in the database 3 tables with > their different information. I have a screen of login with fields > password and user. I want that logging someone, depending on the type > of user who is, jumps to a different screen with his corresponding > layout and home page. I do not have clear how to do this with things > that I have read. Do you know any link or anything where is explained > what I want to do? Dandreta, I have done similar things using the Auth component in CakePHP 1.2. Here are some links to my blog where I talk about it: http://www.littlehart.net/atthekeyboard/?s=Auth That will give you all the posts / tutorials where I talked about using Auth. Hope that helps. -- Chris Hartjes My motto for 2007: "Just build it, damnit!" @TheKeyboard - http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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 -~--~~~~--~~--~--~---
Login of different types of users
Hi!! I am searching and reading enough things on the users' access and permissions (OthAuth, ACL ...). The question is that I want to do the access to my application depending on the type of user. I have 3 types of users:manager, client, supplier and in the database 3 tables with their different information. I have a screen of login with fields password and user. I want that logging someone, depending on the type of user who is, jumps to a different screen with his corresponding layout and home page. I do not have clear how to do this with things that I have read. Do you know any link or anything where is explained what I want to do? Thanks and regards --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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 -~--~~~~--~~--~--~---