Back to index

plone3  3.1.7
Functions
PluggableAuthService.Extensions.basic_auth Namespace Reference

Functions

def extraction
 Copyright (c) 2001 Zope Corporation and Contributors.
def authentication
def authorize

Function Documentation

Authenticate against nested acl_users.

Definition at line 33 of file basic_auth.py.

00033 
00034 def authentication( self, credentials ):
00035 
00036     """ Authenticate against nested acl_users.
00037     """
00038     real_user_folder = self.simple_uf.acl_users
00039 
00040     login = credentials.get( 'login' )
00041     password = credentials.get( 'password' )
00042 
00043     user = real_user_folder.authenticate( login, password, {} )
00044 
00045     return user is not None and login or None
00046 

Fetch user roles from nested acl_users.

Definition at line 47 of file basic_auth.py.

00047 
00048 def authorize( self, user ):
00049 
00050     """ Fetch user roles from nested acl_users.
00051     """
00052     real_user_folder = self.simple_uf.acl_users
00053     real_user = real_user_folder.getUserById( user.getId() )
00054     return real_user.getRoles()

Copyright (c) 2001 Zope Corporation and Contributors.

All Rights Reserved.

This software is subject to the provisions of the Zope Public License, Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.

Fetch HTTP Basic Auth credentials from the request.

Definition at line 20 of file basic_auth.py.

00020 
00021 def extraction( self, request ):
00022 
00023     """ Fetch HTTP Basic Auth credentials from the request.
00024     """
00025     creds = request._authUserPW()
00026 
00027     if creds is not None:
00028         name, password = creds
00029 
00030         return { 'login' : name, 'password' : password }
00031 
00032     return {}