mirror of https://github.com/apache/archiva.git
add ldapgroup mapping UI part
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1450733 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
715f2f3fb6
commit
cf2bbb9032
|
@ -1698,6 +1698,7 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout"
|
||||||
}
|
}
|
||||||
self.modifiesLdapGroupMappings=ko.observableArray([]);
|
self.modifiesLdapGroupMappings=ko.observableArray([]);
|
||||||
}
|
}
|
||||||
|
this.modifiesLdapGroupMappings=ko.observableArray([]);
|
||||||
|
|
||||||
this.modifyLdapGroupMapping=function(roleNames,ldapGroupMapping){
|
this.modifyLdapGroupMapping=function(roleNames,ldapGroupMapping){
|
||||||
var toAdd=true;
|
var toAdd=true;
|
||||||
|
@ -1711,6 +1712,13 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout"
|
||||||
}
|
}
|
||||||
$.log('modifyLdapGroupMapping:'+ldapGroupMapping.group()+','+self.modifiesLdapGroupMappings().length);
|
$.log('modifyLdapGroupMapping:'+ldapGroupMapping.group()+','+self.modifiesLdapGroupMappings().length);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
addLdapGroupMapping=function(){
|
||||||
|
$.log("addLdapGroupMapping");
|
||||||
|
self.redbackRuntimeConfiguration().ldapGroupMappings.push(new LdapGroupMapping("",[],false,self.modifyLdapGroupMapping));
|
||||||
|
$("#ldap-group-mappings-div select" ).select2({width: "element"});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ManagerImplementationInformation=function(beanId,descriptionKey,readOnly){
|
ManagerImplementationInformation=function(beanId,descriptionKey,readOnly){
|
||||||
|
@ -1806,9 +1814,10 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout"
|
||||||
new RedbackRuntimeConfigurationViewModel(redbackRuntimeConfiguration,userManagerImplementationInformations,rbacManagerImplementationInformations);
|
new RedbackRuntimeConfigurationViewModel(redbackRuntimeConfiguration,userManagerImplementationInformations,rbacManagerImplementationInformations);
|
||||||
|
|
||||||
var groups=[];
|
var groups=[];
|
||||||
$.log("before useLdap");
|
$.log("before useLdap:"+$.inArray("ldap",redbackRuntimeConfiguration.userManagerImpls())
|
||||||
var useLdap = $.inArray("ldap",redbackRuntimeConfiguration.userManagerImpls())>0
|
+','+$.inArray("ldap",redbackRuntimeConfiguration.rbacManagerImpls()));
|
||||||
||$.inArray("ldap",redbackRuntimeConfiguration.rbacManagerImpls())>0;
|
var useLdap = $.inArray("ldap",redbackRuntimeConfiguration.userManagerImpls())>=0
|
||||||
|
||$.inArray("ldap",redbackRuntimeConfiguration.rbacManagerImpls())>=0;
|
||||||
$.log("useLdap:"+useLdap);
|
$.log("useLdap:"+useLdap);
|
||||||
if(useLdap){
|
if(useLdap){
|
||||||
// load ldap roles
|
// load ldap roles
|
||||||
|
@ -1887,6 +1896,7 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout"
|
||||||
}
|
}
|
||||||
|
|
||||||
LdapGroupMapping=function(group,roleNames,automatic,subscribeFn){
|
LdapGroupMapping=function(group,roleNames,automatic,subscribeFn){
|
||||||
|
$.log("new LdapGroupMapping");
|
||||||
var self=this;
|
var self=this;
|
||||||
this.modified=ko.observable(false);
|
this.modified=ko.observable(false);
|
||||||
//private String group;
|
//private String group;
|
||||||
|
@ -1894,7 +1904,7 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout"
|
||||||
this.group.subscribe(function(newValue){
|
this.group.subscribe(function(newValue){
|
||||||
self.modified(true);
|
self.modified(true);
|
||||||
if(subscribeFn){
|
if(subscribeFn){
|
||||||
subscribeFn(newValue)
|
subscribeFn(newValue,self)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -1266,17 +1266,29 @@
|
||||||
<tbody id="ldap-group-mappings-tbody">
|
<tbody id="ldap-group-mappings-tbody">
|
||||||
{{each(i, ldapGroupMapping) ldapGroupMappings()}}
|
{{each(i, ldapGroupMapping) ldapGroupMappings()}}
|
||||||
<tr>
|
<tr>
|
||||||
<td>${ldapGroupMapping.group()}</td>
|
<td>${ldapGroupMapping.group()}
|
||||||
|
<select id="roles-group-${ldapGroupMapping.group()}" data-bind="options: ldapGroups, value: ldapGroupMapping.group, optionsCaption: 'Select a LDAP Group'"
|
||||||
|
size="1"></select>
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div>
|
<select id="roles-group-mapping-${ldapGroupMapping.group()}" data-bind="options: $parent.allRoleNames, selectedOptions: ldapGroupMapping.roleNames"
|
||||||
<select id="roles-group-${ldapGroupMapping.group()}" data-bind="options: $parent.allRoleNames, selectedOptions: ldapGroupMapping.roleNames"
|
|
||||||
size="5" multiple="true" ></select>
|
size="5" multiple="true" ></select>
|
||||||
</div>
|
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
<div>
|
||||||
|
<span class="btn btn-success">
|
||||||
|
<i class="icon-plus-sign icon-white" title="add mapping" data-bind="click: function(){ addLdapGroupMapping() }"/>
|
||||||
|
</span>
|
||||||
|
<table class="table table-condensed">
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue