Skip to main content

skip to main content

developerWorks  >  Open source  >

Cook up Web sites fast with CakePHP, Part 2: Bake bigger and better with CakePHP

developerWorks
Go to the previous pagePage 9 of 14 Go to the next page

Document options
PDF format - Fits A4 and Letter

PDF - Fits A4 and Letter
852 KB (39 pages)

Get Adobe® Reader®

Sample code


My developerWorks needs you!

Connect to your technical community


Rate this tutorial

Help us improve this content


Filling in the gaps

With CakePHP, you can build out parts of your application quickly and easily, using scaffolding and Bake. Using ACLs, you can exercise a great deal of control over many aspects of your application. There's more that needs to be done for Tor. Here are some exercises to try.

Dealers

As you may have noticed from the products views that Bake built, there are links in the index view that point to dealers. Like you did with products, use the Cake Console to build a controller and views for dealers. Don't build a model, as you already have one defined and related to products.

Modify the dealer's add action to verify that the dealer name is unique.



Back to top


ACLs

There's a bug in the add action for the products controller. It doesn't check to see who can create a product. This functionality should only be available to users. Fix the bug.

Once you have dealers built, using the ACL skills you have learned, protect all dealer functionality from anyone not belonging to the dealers group.

Once that is complete, using ACLs, allow any user to create a dealer. You will note that the ACOs that are created for products go into ACO groups representing the dealers. How would you set up ACLs so that any member of the dealership could change a product, but only the product creator could delete the product?



Back to top


Views

In the products index view, come up with a way to only display Edit and Delete buttons for products the user can edit or delete.



Back to top



Go to the previous pagePage 9 of 14 Go to the next page