mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Add INTERNAL flag to frontend plugins. If set, the plugin won't show in UI.
This commit is contained in:
parent
c19911845d
commit
43ab2c483d
@ -612,6 +612,8 @@ class help(frontend.Command):
|
|||||||
|
|
||||||
# build help topics
|
# build help topics
|
||||||
for c in self.Command():
|
for c in self.Command():
|
||||||
|
if c.INTERNAL:
|
||||||
|
continue
|
||||||
topic = self._get_command_module(c.module)
|
topic = self._get_command_module(c.module)
|
||||||
if topic:
|
if topic:
|
||||||
self._topics.setdefault(topic, [0]).append(c)
|
self._topics.setdefault(topic, [0]).append(c)
|
||||||
@ -779,7 +781,7 @@ class cli(backend.Executioner):
|
|||||||
self.create_context()
|
self.create_context()
|
||||||
(key, argv) = (argv[0], argv[1:])
|
(key, argv) = (argv[0], argv[1:])
|
||||||
name = from_cli(key)
|
name = from_cli(key)
|
||||||
if name not in self.Command:
|
if name not in self.Command or self.Command[name].INTERNAL:
|
||||||
raise CommandError(name=key)
|
raise CommandError(name=key)
|
||||||
cmd = self.Command[name]
|
cmd = self.Command[name]
|
||||||
kw = self.parse(cmd, argv)
|
kw = self.parse(cmd, argv)
|
||||||
|
@ -201,6 +201,9 @@ class HasParam(Plugin):
|
|||||||
of ``api.env.context``, subclasses can override this with implementations
|
of ``api.env.context``, subclasses can override this with implementations
|
||||||
that consider arbitrary ``api.env`` values.
|
that consider arbitrary ``api.env`` values.
|
||||||
"""
|
"""
|
||||||
|
# HasParam is the base class for most frontend plugins, that make it to users
|
||||||
|
# This flag should be used by UI components to make the plugin unaccessible
|
||||||
|
INTERNAL = False
|
||||||
|
|
||||||
def _get_param_iterable(self, name, verb='takes'):
|
def _get_param_iterable(self, name, verb='takes'):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user