You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by yu...@apache.org on 2013/07/05 20:19:32 UTC
svn commit: r1500090 - in /incubator/ambari/trunk/ambari-web/app:
controllers/main/admin/security/add/step4.js data/secure_mapping.js
Author: yusaku
Date: Fri Jul 5 18:19:32 2013
New Revision: 1500090
URL: http://svn.apache.org/r1500090
Log:
AMBARI-2574. Auth to local shouldn't include hbase rule when hbase not installed. (Antonenko Alexander via yusaku)
Modified:
incubator/ambari/trunk/ambari-web/app/controllers/main/admin/security/add/step4.js
incubator/ambari/trunk/ambari-web/app/data/secure_mapping.js
Modified: incubator/ambari/trunk/ambari-web/app/controllers/main/admin/security/add/step4.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/controllers/main/admin/security/add/step4.js?rev=1500090&r1=1500089&r2=1500090&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/controllers/main/admin/security/add/step4.js (original)
+++ incubator/ambari/trunk/ambari-web/app/controllers/main/admin/security/add/step4.js Fri Jul 5 18:19:32 2013
@@ -222,7 +222,11 @@ App.MainAdminSecurityAddStep4Controller
var uiConfig = [];
var configs = this.get('secureMapping').filterProperty('foreignKey', null);
configs.forEach(function (_config) {
- var value = this.getGlobConfigValue(_config.templateName, _config.value, _config.name);
+ var value = _config.value;
+ if (_config.hasOwnProperty('dependedServiceName') && _config.hasOwnProperty('replace')) {
+ value = this.checkServiceForConfigValue(value, _config.dependedServiceName, _config.replace);
+ }
+ value = this.getGlobConfigValue(_config.templateName, value, _config.name);
uiConfig.pushObject({
"id": "site property",
"name": _config.name,
@@ -245,6 +249,13 @@ App.MainAdminSecurityAddStep4Controller
return uiConfig;
},
+ checkServiceForConfigValue: function(value, serviceName, replace) {
+ if (!App.Service.find().mapProperty('serviceName').contains(serviceName)) {
+ value = value.replace(replace, '');
+ }
+ return value;
+ },
+
/**
* Set all site property that are derived from other puppet-variable
*/
Modified: incubator/ambari/trunk/ambari-web/app/data/secure_mapping.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/data/secure_mapping.js?rev=1500090&r1=1500089&r2=1500090&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/data/secure_mapping.js (original)
+++ incubator/ambari/trunk/ambari-web/app/data/secure_mapping.js Fri Jul 5 18:19:32 2013
@@ -40,7 +40,9 @@ module.exports = [
"foreignKey": null,
"value": "RULE:[2:$1@$0](<templateName[0]>@.*<templateName[1]>)s/.*/<templateName[2]>/\nRULE:[2:$1@$0](<templateName[3]>@.*<templateName[1]>)s/.*/<templateName[2]>/\nRULE:[2:$1@$0](<templateName[4]>@.*<templateName[1]>)s/.*/<templateName[5]>/\nRULE:[2:$1@$0](<templateName[6]>@.*<templateName[1]>)s/.*/<templateName[5]>/\nRULE:[2:$1@$0](<templateName[7]>@.*<templateName[1]>)s/.*/<templateName[8]>/\nDEFAULT",
"filename": "core-site.xml",
- "serviceName": "HDFS"
+ "serviceName": "HDFS",
+ "dependedServiceName": "HBASE",
+ "replace": "\nRULE:[2:$1@$0](<templateName[7]>@.*<templateName[1]>)s/.*/<templateName[8]>/"
},
{
"name": "dfs.namenode.kerberos.principal",