univention.management.console.modules.schoolwizards package#
- class univention.management.console.modules.schoolwizards.OperationType(value)[source]#
Bases:
Enum- CREATE = 0#
- MODIFY = 1#
- DELETE = 2#
- GET = 3#
- univention.management.console.modules.schoolwizards.check_workaround_constraints(subject_schools: Set[str], old_object_schools: Set[str], new_object_schools: Set[str], operation_type: int) bool[source]#
This function checks the constraints for the admin workaround as described in Bug #52757. Returns whether the constraints are fulfilled or not.
Attention! This function does only check the general constrain for DELETE. User deletions are not checked correctly due to their special handling.
- Parameters:
subject_schools – The set of schools the subject is in
old_object_schools – The set of schools the object is in before any modification
new_object_schools – The set of schools the object is in after the modification
operation_type – The type of operation to check the constraints for
- Returns:
True if the operation should be allowed, False otherwise
- univention.management.console.modules.schoolwizards.iter_objects_in_request(request: Any, lo: LoType, operation_type: int, subject_schools: Set[str] = frozenset({}), is_domain_admin: bool = False) Iterator[LibModel][source]#
This function iterates over all given objects given in the request and returns the corresponding UCS@school lib objects already altered with the changes from the request.
- Attention: If the admin workaround is activated (see Bug #52757) certain constraints are checked.
If they are not fulfilled this function aborts with a UMC Error.
- Parameters:
request – The request from the UMCP call containing all the objects to be iterated over.
lo – A LDAP access for retrieving existing UCS@school objects.
operation_type – The type of operation applied onto the returned objects. Necessary for constraint checking.
subject_schools – The schools the user triggering the UMCP command is in. This is needed for constraint checking.
is_domain_admin – If the user triggering the UMCP command is a domain admin or not. This is needed for constraint checking.
- Returns:
An iterator to iterate over the altered or new UCS@school objects.
- Raises:
UMC_Error – If an object that should exist does not or if the admin workaround constraints are not met.
- class univention.management.console.modules.schoolwizards.Instance(*args, **kwargs)[source]#
Bases:
SchoolBaseModule,SchoolImport- property admin_workaround_active#
- property check_password_policies#
- is_domain_admin(request) bool[source]#
Returns if the currently logged in user is a domain admin or not.
- get_user(request)#
- modify_user(request)#
- create_user(request, ldap_user_read=None, ldap_user_write=None, ldap_admin_write=None)#
- get_computer(request)#
- modify_computer(request)#
- delete_computer(request)#
- get_class(request)#
- modify_class(request)#
- create_class(request, ldap_user_read=None, ldap_user_write=None, ldap_admin_write=None)#
- delete_class(request)#
- get_school(request)#
- modify_school(request)#
- create_school(request, ldap_user_read=None, ldap_user_write=None, ldap_admin_write=None)#
- delete_school(request)#
Submodules#
univention.management.console.modules.schoolwizards.SchoolImport module#
- class univention.management.console.modules.schoolwizards.SchoolImport.SchoolImport[source]#
Bases:
objectWrapper for the ucs-school-import script
- SCHOOL_SCRIPT = '/usr/share/ucs-school-import/scripts/create_ou'#
- GROUP_SCRIPT = '/usr/share/ucs-school-import/scripts/import_group'#
- COMPUTER_SCRIPT = '/usr/share/ucs-school-import/scripts/import_computer'#
- MOVE_DC_SCRIPT = '/usr/share/ucs-school-import/scripts/move_domaincontroller_to_ou'#