Having said that, and just like any other other frameworks out there, it is not without some gotchas and caveats IMHO, take a look at the authentication/authorization framework, there is none. Well, not 100% accurate. web2py supports CAS and a rather simple to use layer (Called T2) to authenticate and control permission levels up to the SQL table record level (i.e. a user can "own" a record in a table and only him/her can change it).
I am all up for this approach: Provide the framework, and "pluggable" modules that you can attach into your project and use, there has been some talks in the web2py community about integrating "T2" into the main web2py core, which I personally do not agree on.
So, I needed a specific way of controlling access to this blog, meaning that I should be the only one allowed to create/edit/delete posts, and my readers, should be able to just post comments to it, nothing really fancy, but functional.
I decided to allow *any* visitor who wished to post a comment to any of my posts to do so without having to apply for an account, yes, I know what you're thinking (spam-glalore), but that is why I implemented my "poor man's captcha" (go ahed, add a comment :) - Anyway, I *still* needed to implement some sort of authentication mechanism..
So I did, on every application in web2py you can create a "global" module (A class module, in this case), located (conveniently) in the modules folder of the app, and just instantiate it when the application runs and reads the model, then from that moment, you may use your class at will in your project.
In my case, I created zauth.py. here are its contents:
Now, whenever the user accesses a controller (a URL, such as /zblog/default/index) you can check if AUTH_USER.is_auth() or AUTH_USER.has_role('Administrator') or any ROLE that you decide to add to your application, the class above works fine as is, however, the "new" version of this blog adds encryption to the session to add a slightly harder-to-steal-my-session approach (as suggested by Massimo Di Piero's web2py book.
All that is left to do now is add our custom "login" and "logout" methods and corresponding views (which I did, but since they are not "public", well there is not place IN the UI to click to get to them). I'd be happy to provide you with the full source code for this app. if you wish.
That is it for now, it is always nice to come back from working all day in VS to discover the real fun of programming, python is the best., web2py follows.

