Skip to main content
eick-at moodle
  • Home
  • Calendar
  • More
You are currently using guest access
Log in
eick-at moodle
Home Calendar
Expand all Collapse all
  1. Programming AD with Python
  2. Active Directory
  3. Task: Implementation of AD functionality

Task: Implementation of AD functionality

Completion requirements
Opened: Sunday, 6 October 2019, 12:00 AM
Due: Sunday, 13 October 2019, 12:00 AM

The following methods have to be implemented:

+createStudent(username, nameSchoolClass)
+deleteStudent(username, nameSchoolClass)
+createSchoolClass(nameSchoolClass)   
+deleteSchoolClass(nameSchoolClass)
To ensure that this is done entirely in the PyAD class, it should extend an abstract class. This is where abstract methods are declared that must be defined in the inheriting class:

Abstract class AbstractLDAP describe what subclass PyAD has to do.

Abstract class AbstractLDAP describe what subclass PyAD has to do

(If PyAD class is replaced or supplemented by another class, e.g. by using OpenLDAP or another library, the implementation rule of the abstract class ensures that the full functionality is also implemented here.)


from abc import ABC, abstractmethod     # import Abstract Base Classes (ABCs)

class AbstractLDAP(ABC):                # abstract class 
 
    def __init__(self, dnStudents):
        self._dnStudents = dnStudents
        super().__init__()
    
    @abstractmethod                     # every abstract method has to be defined in subclass
    def createStudent(self, username, nameSchoolClass):
        pass
    @abstractmethod
    def deleteStudent(self, username, nameSchoolClass):
        pass
    @abstractmethod
    def createSchoolClass(self, nameSchoolClass):
        pass
    @abstractmethod
    def deleteSchoolClass(self, nmaeSchoolClass):
        pass

from pyad import *                      # import installed pyad module 

class PyAD(AbstractLDAP):               # Task: implement these 4 methodes in subclass PyAD
    def createStudent(self, username, nameSchoolClass):
        ...
   
    def deleteStudent(self, username, nameSchoolClass):
        ...
   
    def createSchoolClass(self, nameSchoolClass):
        ...
   
    def deleteSchoolClass(self, nameSchoolClass):
        ...

Complete the above method definitions in groups. Each group is responsible for one!

Information sources:
https://pypi.org/project/pyad/
https://zakird.github.io/pyad/


You are currently using guest access (Log in)
Data retention summary
Get the mobile app
Powered by Moodle