mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
actions: Allow nested and top-level actions
- Currently, privileged actions are not allowed under top-level plinth module. They are only allowed under each app module. Allow privileged actions under plinth module. - Currently, privileged actions are not allowed under a sub-module of 'privileged' package. They are allowed only in 'privileged' module. Allow sub-modules under 'privileged' package. Tests: - Email app functional tests pass - Functional tests for apps using package and service privileged methods pass Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
1 parent
74678c1d69
commit
585092ca63
4 files changed
+23
-27
No files matched your search
+5
-1
@@ -59,7 +59,11 @@ def _call(module_name, action_name, arguments):
|
||||
raise SyntaxError('Invalid module name')
|
||||
|
||||
cfg.read()
|
||||
import_path = module_loader.get_module_import_path(module_name)
|
||||
if module_name == 'plinth':
|
||||
import_path = 'plinth'
|
||||
else:
|
||||
import_path = module_loader.get_module_import_path(module_name)
|
||||
|
||||
try:
|
||||
module = importlib.import_module(import_path + '.privileged')
|
||||
except ModuleNotFoundError as exception:
|
||||
|
||||
Reference in new issue
Block a user