forked from public/pyceo
33 lines
955 B
Python
33 lines
955 B
Python
from zope.interface import Interface
|
|
|
|
from .IUser import IUser
|
|
from .IGroup import IGroup
|
|
|
|
|
|
class ILDAPService(Interface):
|
|
"""An interface to the LDAP database."""
|
|
|
|
def get_user(username: str) -> IUser:
|
|
"""Retrieve the user with the given username."""
|
|
|
|
def save_user(user: IUser) -> IUser:
|
|
"""
|
|
Save the user in the database.
|
|
A new UID and GID will be generated and returned in the new user.
|
|
"""
|
|
|
|
def get_group(cn: str, is_club: bool = False) -> IGroup:
|
|
"""Retrieve the group with the given cn (Unix group name)."""
|
|
|
|
def save_group(group: IGroup) -> IGroup:
|
|
"""
|
|
Save the group in the database.
|
|
The GID will not be changed and must be valid.
|
|
"""
|
|
|
|
def modify_user(old_user: IUser, new_user: IUser):
|
|
"""Replace old_user with new_user."""
|
|
|
|
def modify_group(old_group: IGroup, new_group: IGroup):
|
|
"""Replace old_group with new_group."""
|