baseldap: Return empty string when no effective rights are found

DS returns the string "none" when no rights were found. All clients
would need to special-case this value when checking the rights.
Return empty string instead.

https://fedorahosted.org/freeipa/ticket/4359

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
This commit is contained in:
Petr Viktorin committed 2014-07-09 11:39:34 +02:00
1 parent 03c25bd98e
commit fcd2922d86
1 file changed
+4
+4
View File
@@ -210,6 +210,10 @@ def get_effective_rights(ldap, dn, attrs=None):
rights = rights[0].split(', ')
for r in rights:
(k,v) = r.split(':')
if v == 'none':
# the string "none" means "no rights found"
# see https://fedorahosted.org/freeipa/ticket/4359
v = ''
rdict[k.strip().lower()] = v
return rdict