O'Reilly logo

Python 3 Web Development Beginner's Guide by Michel Anders

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action implementing access control

This scenario is implemented in access1.py:

Note

Note: In the code distributed with this chapter and the following one, the logon class is not only initialized with an admin user (with admin as a password) but with the following three name/password combinations: eve/eve, john/john, and mike/mike.

If your run this application and point your browser to http://localhost:8080, you are presented with a list of accounts. If you have logged in as either john or mike both sales persons you can only alter the accounts owned by each of them. If however, you log in as eve, the sales manager, you can alter the information in all accounts.

What just happened?

The application is simple enough and follows a familiar pattern. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required