Univention Bugzilla – Bug 49267
[4.4] create configuration hook that modifies the configuration depending on the imported user role
Last modified: 2019-05-28 14:17:42 CEST
+++ This bug was initially created as a clone of Bug #49266 +++ When importing through the HTTP-API, it is not possible to choose from different configurations (like with the "-c" switch on the command line). Create a configuration hook to manipulate the configuration depending on the imported user roles.
A hook was implemented that manipulates the configuration depending on the imported user role. The hooks changes the configuration depending on the user role being imported. Works only with a fixed user role. Includes an additional configuration file, which must be configured in the main configuration file. Example:: { "include": { "by_role": { "student": "/var/lib/ucs-school-import/configs/students.json", "teacher": "/var/lib/ucs-school-import/configs/teachers.json" } } } If the `user_role` configuration value is `student`, the content of `/var/lib/ucs-school-import/configs/students.json` will be read and applied on top of the current configuration. If the `user_role` configuration value is `staff` or `teacher_and_staff`, nothing will be done. The hook is included in the ucs-school-import distribution in the directory /usr/share/ucs-school-import/pyhooks-available/. [4.4] 492678a23 Bug #37790: added changelog and release notes [4.4] b6d4983fa Bug #49267: configuration hook to modify configuration depending on user role [4.4] 25df3a640 Bug #49265, Bug #49267: test configuration hook [4.4] fd7388a9b Bug #49265, Bug #49267: changelog [4.4] 4b5b7a0d4 Bug #49265, Bug #49267: advisory [4.4] a289df2bf Bug #49267: add hook to sequence diagram (a289df2bf should have been labeled for Bug #49265) ucs-school-import (17.0.6-4)
What I tested (using the http api): Added a hook and imported -> OK Added additional a config hook and imported -> OK (different configs are used) 246_import_user_config_pyhook -> OK YAML -> OK
UCS@school 4.4 v2 has been released. https://docs.software-univention.de/changelog-ucsschool-4.4v2-de.html If this error occurs again, please clone this bug.