Package gavo :: Package protocols :: Module creds
[frames] | no frames]

Module creds

source code

Code for checking against our user db.

We don't use nevow.guard here since we know we're queried via http, but we can't be sure that the other end knows html, and we don't want to fuzz around with sessions. twisted.cred is a different issue but probably only complicates matters unnecessarily.

Functions
 
getGroupsForUser(username, password)
returns a set of all groups user username belongs to.
source code
 
hasCredentials(user, password, reqGroup)
returns true if user and password match the db entry and the user is in the reqGroup.
source code
Variables
  adminProfile = 'admin'
hash(x)
  __package__ = 'gavo.protocols'
Function Details

getGroupsForUser(username, password)

source code 

returns a set of all groups user username belongs to.

If username and password don't match, you'll get an empty set.

hasCredentials(user, password, reqGroup)

source code 

returns true if user and password match the db entry and the user is in the reqGroup.

If reqGroup is None, true will be returned if the user/password pair is in the user table.