Posted on : 12-04-2009 | By : Chuck | In : Uncategorized
0
Decided to get back to work some on the new Content Management System for GreeneCountyIndiana.com. Last time I left off, I was in the process of implementing access control with the News system.
The news system (and lots of other parts of the site) are composed of a variety of associations.
- News belongsTo NewsCategory
- News HABTM Tag
- NewsCategory is an ACO
Access is controlled at the NewsCategory level. You must have read access to the NewsCategory to view the articles in that category. This is easy if you simply want to view articles by category. However, it gets considerably more complicated if you want to browse-by-tag or other criteria.
How in the world can you do a permissions check without requiring an extra query for every single article?
It also doesn’t help that pagination is used, so most means of removing records the user doesn’t have access at the controller level will screw up pagination. In theory you could have empty pages if a user had very limited read access.
Man, access control is complicated.
It’s been less than 2 months since I started on Automotive Manager. In that time, I’ve taken the thing from next to nothing to an almost complete product. I’m not sure how I did any coding without using frameworks before. It makes everything go so much quicker.
So, here’s the screenshots!

The listings index page. This shows all of the categories and the number of listings in each category.

The listings view. This shows all of the listings, along with an image. The information that is shown can be modified by editing the view file.

Viewing the details for a listing. Each picture can be clicked on to be enlarged in a Lightbox window.

Part of the Add Listing form. For added flexibility, listings can be placed in multiple categories.

The photo uploader. Multiple photos can be queued for upload by using the SWFUpload library. A description can be given to each picture before it is uploaded.

Deleting a listing. If you have javascript enabled, you get this modal popup. Automotive Manager will be the first of my software to make use of modal delete windows. When you delete the listing it will be removed from the page using all of that fancy web two point oh ajax stuff.
That’s all the pictures for now. I’m still in the process of testing the software and adding the finishing touches. I have to have it ready to turn in as my class project in a couple weeks, so a live demo should be available around that time.