For the differing user requirements I would say that you need a User
hasOne Profile and then use a factory pattern for Profile to access
StaffProfile, ManagmentProfile etc. where each Profile has a seperate
table etc.

For the ACL you will be best using groups for defining your
permissions.  I wrote a number of tutorials on Groups and ACL on my
blog - link below

For the sub users (accounts users) this gets tricky to describe but is
quite easy to implement.  First the three different sub-user roles get
there own Group and you define the access for them.  Then by making
the sub-users children of the Account manager, you can use the account
managers permissions list to restrict access to certain records only.
I hope this seems clear enough.

Geoff Ford
--
http://lemoncake.wordpress.com


On Aug 2, 5:20 am, "Sonic Baker" <[EMAIL PROTECTED]> wrote:
>    <!-- @page { size: 21cm 29.7cm; margin: 2cm } P { margin-bottom: 0.21cm }
> -->
>
> Hi Bakers,
> I have a problem and I could really use some advice.
> Apart from having multiple types of groups defined in my ACL's I want
> certain users to have extra associated information.
>
> For example:
>
>   General Staff:
>
>     Staff members have a home addresses and a Tax number
>
>   Management:
>
>     Management will have a home addresses, a Tax number and a Vehicle
>
>   Customers:
>
>     When a customer registers they will be the administrator of their
> accounts. A Customer can register many Accounts. Once registered, they will
> be allowed to (or required to) register 3 different types of users for each
> account. Each Account user will have different permissions for accessing
> areas of the account back-end and each account user will also have different
> types of additional information associated with them.
>
> The 3 types of account user are:
>   admins -> have access to all functionality
>   managers -> can view stats and use basic functionality
>   billing contacts -> can view invoices
>
> Account Admins will have a phone number, fax and email
> Account Managers will have a phone number, alternative phone number, fax and
> email
> Account Billing Contacts will have a phone number, and email
>
> There is a table for `customers` and a table for `accounts`.
>
>   Customer hasMany Account
>
> So far the `accounts` table holds the info about the all three types of
> account user.
>
> There is a separate table for `staff_members`.
>
>   StaffMember hasOne Address
>
> There is a separate table for `management_members`
>
>   ManagementMember hasOne Address
>
>   ManagementMember hasOne Vehicle
>
> Now I'm trying to implement the Auth and ACL stuff. I left this till I had
> some base functionality down as I was going for most business value first.
> I'm trying a few different types of CakePHP Auth and ACL systems to see
> which will be the most suitable. I see now that a single  `users` table is
> required.
>
> So when a user logs in, I'll want to check what group they belong to. If
> they are of type:
>
>   Staff:
>
>     I'll want to access their extra information from the Staff and
> associated Address models.
>
>   Management:
>
>      I'll want to access their extra information from the Management and
> associated Address and Vehicle models.
>
>   Account Admin, Manager or Billing Contact:
>
>      I'll probably want an 'account_id' in the User model and look in the
> relevant Account to get their extra information like phone numbers etc. This
> will mean having the account_id set to '0' for StaffMember and
> ManagementMember because they will not have accounts in the sense a Customer
> can.
>
> It all seems a bit ridiculous to me now. It's starting to melt my head to be
> honest. Can anyone see an alternative arrangement which would take care of
> my requirements. I was considering the Subtype/Supertype method on the User
> model but this could bet messy also.
>
> I'd really appreciate any help of suggestions.
>
> Cheers,
>
> Sonic


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to