Make ipa permission-add ask for optional attributes

Either one of type, filter, subtree, targetgroup, attrs or memberof is
required.

https://fedorahosted.org/freeipa/ticket/819
This commit is contained in:
Jan Zeleny 2011-01-21 13:38:30 -05:00 committed by Rob Crittenden
parent cf9ec1c427
commit 9b7920b0f5

View File

@ -116,32 +116,38 @@ class permission(LDAPObject):
label=_('Attributes'),
doc=_('Comma-separated list of attributes'),
normalizer=lambda value: value.lower(),
alwaysask=True,
),
StrEnum('type?',
cli_name='type',
label=_('Type'),
doc=_('Type of IPA object (user, group, host, hostgroup, service, netgroup, dns)'),
values=(u'user', u'group', u'host', u'service', u'hostgroup', u'netgroup', u'dns',),
alwaysask=True,
),
Str('memberof?',
cli_name='memberof',
label=_('Member of group'), # FIXME: Does this label make sense?
doc=_('Target members of a group'),
alwaysask=True,
),
Str('filter?',
cli_name='filter',
label=_('Filter'),
doc=_('Legal LDAP filter (e.g. ou=Engineering)'),
alwaysask=True,
),
Str('subtree?',
cli_name='subtree',
label=_('Subtree'),
doc=_('Subtree to apply permissions to'),
alwaysask=True,
),
Str('targetgroup?',
cli_name='targetgroup',
label=_('Target group'),
doc=_('User group to apply permissions to'),
alwaysask=True,
),
)