pyceo/ceo_common/interfaces/IFileService.py

30 lines
739 B
Python
Raw Normal View History

2021-07-23 20:08:22 -04:00
from typing import List
from zope.interface import Interface
2021-07-24 17:09:10 -04:00
from .IUser import IUser
2021-07-23 20:08:22 -04:00
class IFileService(Interface):
"""
A service which can access, create and modify files on the
NFS users' directory.
"""
2021-07-24 17:09:10 -04:00
def create_home_dir(user: IUser):
2021-07-23 20:08:22 -04:00
"""
Create a new home dir for the given user or club.
"""
2021-07-24 17:09:10 -04:00
def delete_home_dir(user: IUser):
"""Permanently delete a user's home dir."""
def get_forwarding_addresses(user: IUser) -> List[str]:
2021-07-23 20:08:22 -04:00
"""
Get the contents of the user's ~/.forward file,
one line at a time.
"""
2021-07-24 17:09:10 -04:00
def set_forwarding_addresses(user: IUser, addresses: List[str]):
2021-07-23 20:08:22 -04:00
"""Set the contents of the user's ~/.forward file."""