Blame SOURCES/0004-baseuser-fix-ipanthomedirectorydrive-option-name_rhbz#1851411.patch

f56551
From a090b429fda35c5a9c3cfb672ab42a5985d00ff9 Mon Sep 17 00:00:00 2001
f56551
From: Petr Vobornik <pvoborni@redhat.com>
f56551
Date: Mon, 8 Jun 2020 19:27:30 +0200
f56551
Subject: [PATCH] baseuser: fix ipanthomedirectorydrive option name
f56551
f56551
It should be ipanthomedirectorydrive and not ipanthomedirectoryrive.
f56551
f56551
This fixes showing the field in Web UI and also should fix CLI as it
f56551
probably never worked.
f56551
f56551
Signed-off-by: Petr Vobornik <pvoborni@redhat.com>
f56551
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
f56551
---
f56551
 API.txt                       | 8 ++++----
f56551
 ipaserver/plugins/baseuser.py | 2 +-
f56551
 2 files changed, 5 insertions(+), 5 deletions(-)
f56551
f56551
diff --git a/API.txt b/API.txt
f56551
index 5354a33a0..300b3d9b1 100644
f56551
--- a/API.txt
f56551
+++ b/API.txt
f56551
@@ -5085,7 +5085,7 @@ option: Str('in_role*', cli_name='in_roles')
f56551
 option: Str('in_sudorule*', cli_name='in_sudorules')
f56551
 option: Str('initials?', autofill=False)
f56551
 option: Str('ipanthomedirectory?', autofill=False, cli_name='smb_home_dir')
f56551
-option: StrEnum('ipanthomedirectoryrive?', autofill=False, cli_name='smb_home_drive', values=[u'A:', u'B:', u'C:', u'D:', u'E:', u'F:', u'G:', u'H:', u'I:', u'J:', u'K:', u'L:', u'M:', u'N:', u'O:', u'P:', u'Q:', u'R:', u'S:', u'T:', u'U:', u'V:', u'W:', u'X:', u'Y:', u'Z:'])
f56551
+option: StrEnum('ipanthomedirectorydrive?', autofill=False, cli_name='smb_home_drive', values=[u'A:', u'B:', u'C:', u'D:', u'E:', u'F:', u'G:', u'H:', u'I:', u'J:', u'K:', u'L:', u'M:', u'N:', u'O:', u'P:', u'Q:', u'R:', u'S:', u'T:', u'U:', u'V:', u'W:', u'X:', u'Y:', u'Z:'])
f56551
 option: Str('ipantlogonscript?', autofill=False, cli_name='smb_logon_script')
f56551
 option: Str('ipantprofilepath?', autofill=False, cli_name='smb_profile_path')
f56551
 option: Str('ipatokenradiusconfiglink?', autofill=False, cli_name='radius')
f56551
@@ -5147,7 +5147,7 @@ option: Str('givenname?', autofill=False, cli_name='first')
f56551
 option: Str('homedirectory?', autofill=False, cli_name='homedir')
f56551
 option: Str('initials?', autofill=False)
f56551
 option: Str('ipanthomedirectory?', autofill=False, cli_name='smb_home_dir')
f56551
-option: StrEnum('ipanthomedirectoryrive?', autofill=False, cli_name='smb_home_drive', values=[u'A:', u'B:', u'C:', u'D:', u'E:', u'F:', u'G:', u'H:', u'I:', u'J:', u'K:', u'L:', u'M:', u'N:', u'O:', u'P:', u'Q:', u'R:', u'S:', u'T:', u'U:', u'V:', u'W:', u'X:', u'Y:', u'Z:'])
f56551
+option: StrEnum('ipanthomedirectorydrive?', autofill=False, cli_name='smb_home_drive', values=[u'A:', u'B:', u'C:', u'D:', u'E:', u'F:', u'G:', u'H:', u'I:', u'J:', u'K:', u'L:', u'M:', u'N:', u'O:', u'P:', u'Q:', u'R:', u'S:', u'T:', u'U:', u'V:', u'W:', u'X:', u'Y:', u'Z:'])
f56551
 option: Str('ipantlogonscript?', autofill=False, cli_name='smb_logon_script')
f56551
 option: Str('ipantprofilepath?', autofill=False, cli_name='smb_profile_path')
f56551
 option: Str('ipasshpubkey*', autofill=False, cli_name='sshpubkey')
f56551
@@ -6185,7 +6185,7 @@ option: Str('in_role*', cli_name='in_roles')
f56551
 option: Str('in_sudorule*', cli_name='in_sudorules')
f56551
 option: Str('initials?', autofill=False)
f56551
 option: Str('ipanthomedirectory?', autofill=False, cli_name='smb_home_dir')
f56551
-option: StrEnum('ipanthomedirectoryrive?', autofill=False, cli_name='smb_home_drive', values=[u'A:', u'B:', u'C:', u'D:', u'E:', u'F:', u'G:', u'H:', u'I:', u'J:', u'K:', u'L:', u'M:', u'N:', u'O:', u'P:', u'Q:', u'R:', u'S:', u'T:', u'U:', u'V:', u'W:', u'X:', u'Y:', u'Z:'])
f56551
+option: StrEnum('ipanthomedirectorydrive?', autofill=False, cli_name='smb_home_drive', values=[u'A:', u'B:', u'C:', u'D:', u'E:', u'F:', u'G:', u'H:', u'I:', u'J:', u'K:', u'L:', u'M:', u'N:', u'O:', u'P:', u'Q:', u'R:', u'S:', u'T:', u'U:', u'V:', u'W:', u'X:', u'Y:', u'Z:'])
f56551
 option: Str('ipantlogonscript?', autofill=False, cli_name='smb_logon_script')
f56551
 option: Str('ipantprofilepath?', autofill=False, cli_name='smb_profile_path')
f56551
 option: Str('ipatokenradiusconfiglink?', autofill=False, cli_name='radius')
f56551
@@ -6250,7 +6250,7 @@ option: Str('givenname?', autofill=False, cli_name='first')
f56551
 option: Str('homedirectory?', autofill=False, cli_name='homedir')
f56551
 option: Str('initials?', autofill=False)
f56551
 option: Str('ipanthomedirectory?', autofill=False, cli_name='smb_home_dir')
f56551
-option: StrEnum('ipanthomedirectoryrive?', autofill=False, cli_name='smb_home_drive', values=[u'A:', u'B:', u'C:', u'D:', u'E:', u'F:', u'G:', u'H:', u'I:', u'J:', u'K:', u'L:', u'M:', u'N:', u'O:', u'P:', u'Q:', u'R:', u'S:', u'T:', u'U:', u'V:', u'W:', u'X:', u'Y:', u'Z:'])
f56551
+option: StrEnum('ipanthomedirectorydrive?', autofill=False, cli_name='smb_home_drive', values=[u'A:', u'B:', u'C:', u'D:', u'E:', u'F:', u'G:', u'H:', u'I:', u'J:', u'K:', u'L:', u'M:', u'N:', u'O:', u'P:', u'Q:', u'R:', u'S:', u'T:', u'U:', u'V:', u'W:', u'X:', u'Y:', u'Z:'])
f56551
 option: Str('ipantlogonscript?', autofill=False, cli_name='smb_logon_script')
f56551
 option: Str('ipantprofilepath?', autofill=False, cli_name='smb_profile_path')
f56551
 option: Str('ipasshpubkey*', autofill=False, cli_name='sshpubkey')
f56551
diff --git a/ipaserver/plugins/baseuser.py b/ipaserver/plugins/baseuser.py
f56551
index a0ed65874..e1b7763f0 100644
f56551
--- a/ipaserver/plugins/baseuser.py
f56551
+++ b/ipaserver/plugins/baseuser.py
f56551
@@ -420,7 +420,7 @@ class baseuser(LDAPObject):
f56551
             label=_('SMB Home Directory'),
f56551
             flags=['no_create'],
f56551
             ),
f56551
-        StrEnum('ipanthomedirectoryrive?',
f56551
+        StrEnum('ipanthomedirectorydrive?',
f56551
                 cli_name='smb_home_drive',
f56551
                 label=_('SMB Home Directory Drive'),
f56551
                 flags=['no_create'],
f56551
-- 
f56551
2.26.2
f56551
f56551
From 691b3cddb275821630f443f22706fa75e7c7a5c8 Mon Sep 17 00:00:00 2001
f56551
From: Petr Vobornik <pvoborni@redhat.com>
f56551
Date: Mon, 8 Jun 2020 19:11:33 +0200
f56551
Subject: [PATCH] webui: hide user attributes for SMB services section if empty
f56551
f56551
This section should be hidded if user object hasn't ipantuserattrs
f56551
object class. I.e. when trusts are not enabled.
f56551
f56551
Web UI framework already supports hidding of sections if the
f56551
section contains no visible field. So to achieve it we simply needs
f56551
to hide the fields. Given that attributelevelrights
f56551
contains rights only for attributes of current object classes, all
f56551
of these are regarded as not writable.
f56551
f56551
We can leverage feature of input_widget that it gets hidden
f56551
when the attribute is not writable and has no value and widget's
f56551
"hidden_if_empty" is set to true. Thus doing it here.
f56551
f56551
For this to work, it is also required to fix an issue with
f56551
"ipanthomedirectorydrive" which is optional (in API) but Web UI
f56551
doesn't offer "empty" ("") value. Adding it here.
f56551
f56551
fixes: https://pagure.io/freeipa/issue/8336
f56551
f56551
Signed-off-by: Petr Vobornik <pvoborni@redhat.com>
f56551
Reviewed-By: Serhii Tsymbaliuk <stsymbal@redhat.com>
f56551
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
f56551
---
f56551
 install/ui/src/freeipa/user.js | 20 +++++++++++---------
f56551
 1 file changed, 11 insertions(+), 9 deletions(-)
f56551
f56551
diff --git a/install/ui/src/freeipa/user.js b/install/ui/src/freeipa/user.js
f56551
index fb626f2a1..8f1f5cd85 100644
f56551
--- a/install/ui/src/freeipa/user.js
f56551
+++ b/install/ui/src/freeipa/user.js
f56551
@@ -367,36 +367,39 @@ return {
f56551
                 {
f56551
                     name: 'smb_attributes',
f56551
                     label: '@i18n:objects.smb_attributes.title',
f56551
-                    show_cond: ['oc_ipantuserattrs'],
f56551
                     fields: [{
f56551
                             name: 'ipantlogonscript',
f56551
                             tooltip: {
f56551
                                 title: '@i18n:objects.smb_attributes.ipantlogonscript_tooltip'
f56551
-                            }
f56551
+                            },
f56551
+                            hidden_if_empty: true
f56551
                         },
f56551
                         {
f56551
                             name: 'ipantprofilepath',
f56551
                             tooltip: {
f56551
                                 title: '@i18n:objects.smb_attributes.ipantprofilepath_tooltip'
f56551
-                            }
f56551
+                            },
f56551
+                            hidden_if_empty: true
f56551
                         },
f56551
                         {
f56551
                             name: 'ipanthomedirectory',
f56551
                             tooltip: {
f56551
                                 title: '@i18n:objects.smb_attributes.ipanthomedirectory_tooltip'
f56551
-                            }
f56551
+                            },
f56551
+                            hidden_if_empty: true
f56551
                         },
f56551
                         {
f56551
                             name: 'ipanthomedirectorydrive',
f56551
                             $type: 'select',
f56551
                             options: IPA.create_options([
f56551
-                                'A:', 'B:', 'C:', 'D:', 'E:', 'F:', 'G:', 'H:', 'I:',
f56551
-                                'J:', 'K:', 'L:', 'M:', 'N:', 'O:', 'P:', 'Q:', 'R:',
f56551
-                                'S:', 'T:', 'U:', 'V:', 'W:', 'X:', 'Y:', 'Z:'
f56551
+                                '', 'A:', 'B:', 'C:', 'D:', 'E:', 'F:', 'G:', 'H:',
f56551
+                                'I:', 'J:', 'K:', 'L:', 'M:', 'N:', 'O:', 'P:', 'Q:',
f56551
+                                'R:', 'S:', 'T:', 'U:', 'V:', 'W:', 'X:', 'Y:', 'Z:'
f56551
                             ]),
f56551
                             tooltip: {
f56551
                                 title: '@i18n:objects.smb_attributes.ipanthomedirectorydrive_tooltip'
f56551
-                            }
f56551
+                            },
f56551
+                            hidden_if_empty: true
f56551
                         }
f56551
                     ]
f56551
                 }
f56551
@@ -482,7 +485,6 @@ return {
f56551
                     IPA.user.self_service_other_user_evaluator,
f56551
                     IPA.user.preserved_user_evaluator,
f56551
                     IPA.user.is_locked_evaluator,
f56551
-                    IPA.object_class_evaluator,
f56551
                     IPA.cert.certificate_evaluator
f56551
                 ],
f56551
                 summary_conditions: [
f56551
-- 
f56551
2.26.2
f56551