3f51ca
From 8c4561a1ea598f645c33a8ed2f0c841326b2373d Mon Sep 17 00:00:00 2001
3f51ca
From: Pavel Vomacka <pvomacka@redhat.com>
3f51ca
Date: Thu, 14 Dec 2017 15:14:03 +0100
3f51ca
Subject: [PATCH] WebUI: make keytab tables on service and host pages writable
3f51ca
3f51ca
There is no object class before adding the first item into tables,
3f51ca
therefore there are no ACI and WebUI is not able to figure out
3f51ca
whether table is writable or not. Adding flag 'w_if_no_aci'
3f51ca
tells "make it writable even if we have not ACIs and try to do
3f51ca
the API call.
3f51ca
3f51ca
https://pagure.io/freeipa/issue/7111
3f51ca
3f51ca
Reviewed-By: Felipe Volpone <fbarreto@redhat.com>
3f51ca
---
3f51ca
 install/ui/src/freeipa/host.js    | 8 ++++++++
3f51ca
 install/ui/src/freeipa/service.js | 8 ++++++++
3f51ca
 2 files changed, 16 insertions(+)
3f51ca
3f51ca
diff --git a/install/ui/src/freeipa/host.js b/install/ui/src/freeipa/host.js
3f51ca
index ac434d8455384ded2cbebc28445deaecbafc46b5..acecff1e5b99c541b216a3e6789efb77eb262fef 100644
3f51ca
--- a/install/ui/src/freeipa/host.js
3f51ca
+++ b/install/ui/src/freeipa/host.js
3f51ca
@@ -198,6 +198,7 @@ return {
3f51ca
                             $type: 'association_table',
3f51ca
                             id: 'host_ipaallowedtoperform_read_keys_user',
3f51ca
                             name: 'ipaallowedtoperform_read_keys_user',
3f51ca
+                            flags: ['w_if_no_aci'],
3f51ca
                             add_method: 'allow_retrieve_keytab',
3f51ca
                             remove_method: 'disallow_retrieve_keytab',
3f51ca
                             add_title: '@i18n:keytab.add_retrive',
3f51ca
@@ -214,6 +215,7 @@ return {
3f51ca
                             $type: 'association_table',
3f51ca
                             id: 'host_ipaallowedtoperform_read_keys_group',
3f51ca
                             name: 'ipaallowedtoperform_read_keys_group',
3f51ca
+                            flags: ['w_if_no_aci'],
3f51ca
                             add_method: 'allow_retrieve_keytab',
3f51ca
                             remove_method: 'disallow_retrieve_keytab',
3f51ca
                             add_title: '@i18n:keytab.add_retrive',
3f51ca
@@ -230,6 +232,7 @@ return {
3f51ca
                             $type: 'association_table',
3f51ca
                             id: 'service_ipaallowedtoperform_read_keys_host',
3f51ca
                             name: 'ipaallowedtoperform_read_keys_host',
3f51ca
+                            flags: ['w_if_no_aci'],
3f51ca
                             add_method: 'allow_retrieve_keytab',
3f51ca
                             remove_method: 'disallow_retrieve_keytab',
3f51ca
                             add_title: '@i18n:keytab.add_retrive',
3f51ca
@@ -246,6 +249,7 @@ return {
3f51ca
                             $type: 'association_table',
3f51ca
                             id: 'service_ipaallowedtoperform_read_keys_hostgroup',
3f51ca
                             name: 'ipaallowedtoperform_read_keys_hostgroup',
3f51ca
+                            flags: ['w_if_no_aci'],
3f51ca
                             add_method: 'allow_retrieve_keytab',
3f51ca
                             remove_method: 'disallow_retrieve_keytab',
3f51ca
                             add_title: '@i18n:keytab.add_retrive',
3f51ca
@@ -269,6 +273,7 @@ return {
3f51ca
                             $type: 'association_table',
3f51ca
                             id: 'host_ipaallowedtoperform_write_keys_user',
3f51ca
                             name: 'ipaallowedtoperform_write_keys_user',
3f51ca
+                            flags: ['w_if_no_aci'],
3f51ca
                             add_method: 'allow_create_keytab',
3f51ca
                             remove_method: 'disallow_create_keytab',
3f51ca
                             add_title: '@i18n:keytab.add_create',
3f51ca
@@ -285,6 +290,7 @@ return {
3f51ca
                             $type: 'association_table',
3f51ca
                             id: 'host_ipaallowedtoperform_write_keys_group',
3f51ca
                             name: 'ipaallowedtoperform_write_keys_group',
3f51ca
+                            flags: ['w_if_no_aci'],
3f51ca
                             add_method: 'allow_create_keytab',
3f51ca
                             remove_method: 'disallow_create_keytab',
3f51ca
                             add_title: '@i18n:keytab.add_create',
3f51ca
@@ -301,6 +307,7 @@ return {
3f51ca
                             $type: 'association_table',
3f51ca
                             id: 'service_ipaallowedtoperform_write_keys_host',
3f51ca
                             name: 'ipaallowedtoperform_write_keys_host',
3f51ca
+                            flags: ['w_if_no_aci'],
3f51ca
                             add_method: 'allow_create_keytab',
3f51ca
                             remove_method: 'disallow_create_keytab',
3f51ca
                             add_title: '@i18n:keytab.add_create',
3f51ca
@@ -317,6 +324,7 @@ return {
3f51ca
                             $type: 'association_table',
3f51ca
                             id: 'service_ipaallowedtoperform_write_keys_hostgroup',
3f51ca
                             name: 'ipaallowedtoperform_write_keys_hostgroup',
3f51ca
+                            flags: ['w_if_no_aci'],
3f51ca
                             add_method: 'allow_create_keytab',
3f51ca
                             remove_method: 'disallow_create_keytab',
3f51ca
                             add_title: '@i18n:keytab.add_create',
3f51ca
diff --git a/install/ui/src/freeipa/service.js b/install/ui/src/freeipa/service.js
3f51ca
index 752ff98e3e5290442ce5f011a4de53ccc0db8f8f..c798d2999fc909fdbc26b016e4752a3edf1f702e 100644
3f51ca
--- a/install/ui/src/freeipa/service.js
3f51ca
+++ b/install/ui/src/freeipa/service.js
3f51ca
@@ -201,6 +201,7 @@ return {
3f51ca
                             $type: 'association_table',
3f51ca
                             id: 'service_ipaallowedtoperform_read_keys_user',
3f51ca
                             name: 'ipaallowedtoperform_read_keys_user',
3f51ca
+                            flags: ['w_if_no_aci'],
3f51ca
                             add_method: 'allow_retrieve_keytab',
3f51ca
                             remove_method: 'disallow_retrieve_keytab',
3f51ca
                             add_title: '@i18n:keytab.add_retrive',
3f51ca
@@ -217,6 +218,7 @@ return {
3f51ca
                             $type: 'association_table',
3f51ca
                             id: 'service_ipaallowedtoperform_read_keys_group',
3f51ca
                             name: 'ipaallowedtoperform_read_keys_group',
3f51ca
+                            flags: ['w_if_no_aci'],
3f51ca
                             add_method: 'allow_retrieve_keytab',
3f51ca
                             remove_method: 'disallow_retrieve_keytab',
3f51ca
                             add_title: '@i18n:keytab.add_retrive',
3f51ca
@@ -233,6 +235,7 @@ return {
3f51ca
                             $type: 'association_table',
3f51ca
                             id: 'service_ipaallowedtoperform_read_keys_host',
3f51ca
                             name: 'ipaallowedtoperform_read_keys_host',
3f51ca
+                            flags: ['w_if_no_aci'],
3f51ca
                             add_method: 'allow_retrieve_keytab',
3f51ca
                             remove_method: 'disallow_retrieve_keytab',
3f51ca
                             add_title: '@i18n:keytab.add_retrive',
3f51ca
@@ -249,6 +252,7 @@ return {
3f51ca
                             $type: 'association_table',
3f51ca
                             id: 'service_ipaallowedtoperform_read_keys_hostgroup',
3f51ca
                             name: 'ipaallowedtoperform_read_keys_hostgroup',
3f51ca
+                            flags: ['w_if_no_aci'],
3f51ca
                             add_method: 'allow_retrieve_keytab',
3f51ca
                             remove_method: 'disallow_retrieve_keytab',
3f51ca
                             add_title: '@i18n:keytab.add_retrive',
3f51ca
@@ -272,6 +276,7 @@ return {
3f51ca
                             $type: 'association_table',
3f51ca
                             id: 'service_ipaallowedtoperform_write_keys_user',
3f51ca
                             name: 'ipaallowedtoperform_write_keys_user',
3f51ca
+                            flags: ['w_if_no_aci'],
3f51ca
                             add_method: 'allow_create_keytab',
3f51ca
                             remove_method: 'disallow_create_keytab',
3f51ca
                             add_title: '@i18n:keytab.add_create',
3f51ca
@@ -288,6 +293,7 @@ return {
3f51ca
                             $type: 'association_table',
3f51ca
                             id: 'service_ipaallowedtoperform_write_keys_group',
3f51ca
                             name: 'ipaallowedtoperform_write_keys_group',
3f51ca
+                            flags: ['w_if_no_aci'],
3f51ca
                             add_method: 'allow_create_keytab',
3f51ca
                             remove_method: 'disallow_create_keytab',
3f51ca
                             add_title: '@i18n:keytab.add_create',
3f51ca
@@ -304,6 +310,7 @@ return {
3f51ca
                             $type: 'association_table',
3f51ca
                             id: 'service_ipaallowedtoperform_write_keys_host',
3f51ca
                             name: 'ipaallowedtoperform_write_keys_host',
3f51ca
+                            flags: ['w_if_no_aci'],
3f51ca
                             add_method: 'allow_create_keytab',
3f51ca
                             remove_method: 'disallow_create_keytab',
3f51ca
                             add_title: '@i18n:keytab.add_create',
3f51ca
@@ -320,6 +327,7 @@ return {
3f51ca
                             $type: 'association_table',
3f51ca
                             id: 'service_ipaallowedtoperform_write_keys_hostgroup',
3f51ca
                             name: 'ipaallowedtoperform_write_keys_hostgroup',
3f51ca
+                            flags: ['w_if_no_aci'],
3f51ca
                             add_method: 'allow_create_keytab',
3f51ca
                             remove_method: 'disallow_create_keytab',
3f51ca
                             add_title: '@i18n:keytab.add_create',
3f51ca
-- 
3f51ca
2.13.6
3f51ca