Files
test-auth/sso/services/__init__.py
Andrew Williams 53630f980f Various changes to several aspects of the model base.
* Added SSOUser extension profile for auth
* Now checks for Corp membership and executes required commands
* Various small fixups
2010-02-25 15:49:56 +00:00

43 lines
895 B
Python

def get_api(api):
try:
mod = __import__(api)
except ImportError:
raise DoesNotExist('Error creating service')
for i in api.split(".")[1:]:
mod = getattr(mod, i)
return getattr(mod, mod.ServiceClass)()
class BaseService():
"""
Base Service class, all service classes should inherit from this
"""
def add_user(self, username, password):
""" Add a user """
pass
def set_corp(self, username):
""" User is in corp, enable extra privs """
pass
def delete_user(self, username):
""" Delete a user """
pass
def disable_user(self, username):
""" Disable a user """
pass
def enable_user(self, username, password):
""" Enable a user """
pass
def check_user(self, username):
""" Check if the username exists """
pass