mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-25 08:21:05 -06:00
Default the token owner to the person adding the token
Creating tokens for yourself is the most common operation. Making this the default optimizes for the common case. Reviewed-By: Simo Sorce <simo@redhat.com> Reviewed-By: Jan Cholasta <jcholast@redhat.com>
This commit is contained in:
parent
5afa3c1815
commit
db7d0219ba
@ -244,7 +244,14 @@ class otptoken_add(LDAPCreate):
|
||||
if tattr in entry_attrs:
|
||||
del entry_attrs[tattr]
|
||||
|
||||
# Resolve the user's dn
|
||||
# If owner was not specified, default to the person adding this token.
|
||||
if 'ipatokenowner' not in entry_attrs:
|
||||
result = self.api.Command.user_find(whoami=True)['result']
|
||||
if result:
|
||||
cur_uid = result[0]['uid'][0]
|
||||
entry_attrs.setdefault('ipatokenowner', cur_uid)
|
||||
|
||||
# Resolve the owner's dn
|
||||
_normalize_owner(self.api.Object.user, entry_attrs)
|
||||
|
||||
# Get the issuer for the URI
|
||||
|
Loading…
Reference in New Issue
Block a user