midgard_user_auth

Posted on 2007-12-17 14:11:41 EET.

I started to make new Midgard2 auth features backward compatible. So, to make things smooth and transparent I added new internal function which makes legacy authorization and it's triggered by simple check, check if new midgard_user table exists in database.

The good start:

  • database is created with midgard branch-1-9
  • python is used as scripting language
  • midgard2 library is used with test

And simple example code:

user = midgard.user.auth("admin", "password", "python-sg", False);
if(midgard.user.is_admin(user)):
    print ("User is an admin")

Output with method names info:

** INFO: user.is_admin(...)
User is an admin

I didn't make any database changes, so let's hope both midgard versions could be used together soon.

Back

Layout Copyright © 2006 Finnish Teleservice Center Ltd Oy - Site Powered by Midgard CMS