title: Coding style of security hierarchy with coldfusion
body: <p>I've been creating this pretty large web application for sometime and have been updating it. Overtime, I've learned a lot more things to make the system more functional. Now, I'm going back and trying to get rid of code that isn't re-useable or is just plain odd/ quirky. </p>
  
  <p>My first step is looking at my security hierarchy. My system runs on a security level backbone. X level can view X stuff...etc.</p>
  
  <p>What is the best way to code that? Right now, I have a query that retrieves their security level and sets it as a session variable. These people can also belong to many other "departments" with different security levels. (The department is also stored as a session variable.) The webpages in my system check in my header to see if they can access the page or not. However, there is some places where I have dynamic forms and data that only certain security levels can view. In these areas I pretty much have cfif statements saying if security equals a certain level...show them this or show them that. So, on the same page someone might see something different.</p>
  
  <p>Is there a better way to handle this? I feel like my code isn't as good as it could be. (Well, it will never be as good as it could be.) I'm basically looking for suggestions on how to handle a security hierarchy in a better way. </p>
  
  <p>(Note: I already have the system coded just looking for advise on coding style or verification if what I'm doing sounds right!")</p>
  
  <p>I'm also working on getting my queries more function like...and all in one place so they are not floating around randomly on some pages. </p>