CakePHP routing a role to a prefix with a different name

161 views Asked by At

I have the following user roles in my application:

Admin Client Contractor

They are controlled by ACL for each function / page.

I want to create a new one called Client_site. But I want this new role to route through to the Client prefixed pages. e.g. /client/:controller/:action

Basically I want it to use all the same pages as the client role, but just have read only access to them. Which I have set up in the ACL tables.

How would I set this up in the routing?

Also is there anything else I will need to amend to get this working?

1

There are 1 answers

0
StringsOnFire On BEST ANSWER

If you mean read only access to your data, then you'd need to have separate functions for the new role, otherwise they'd still have the same access given to client. It makes sense to follow the guidelines. For example, you'd have a newrole_index, and a newrole_index.ctp, so the newrole does't have the same view as the client. You don't want your users see buttons that lead to places they can't actually go, which would happen if you shared the prefix with them.