}
self.modifiesLdapGroupMappings=ko.observableArray([]);
}
+ this.modifiesLdapGroupMappings=ko.observableArray([]);
this.modifyLdapGroupMapping=function(roleNames,ldapGroupMapping){
var toAdd=true;
}
$.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){
new RedbackRuntimeConfigurationViewModel(redbackRuntimeConfiguration,userManagerImplementationInformations,rbacManagerImplementationInformations);
var groups=[];
- $.log("before useLdap");
- var useLdap = $.inArray("ldap",redbackRuntimeConfiguration.userManagerImpls())>0
- ||$.inArray("ldap",redbackRuntimeConfiguration.rbacManagerImpls())>0;
+ $.log("before useLdap:"+$.inArray("ldap",redbackRuntimeConfiguration.userManagerImpls())
+ +','+$.inArray("ldap",redbackRuntimeConfiguration.rbacManagerImpls()));
+ var useLdap = $.inArray("ldap",redbackRuntimeConfiguration.userManagerImpls())>=0
+ ||$.inArray("ldap",redbackRuntimeConfiguration.rbacManagerImpls())>=0;
$.log("useLdap:"+useLdap);
if(useLdap){
// load ldap roles
}
LdapGroupMapping=function(group,roleNames,automatic,subscribeFn){
+ $.log("new LdapGroupMapping");
var self=this;
this.modified=ko.observable(false);
//private String group;
this.group.subscribe(function(newValue){
self.modified(true);
if(subscribeFn){
- subscribeFn(newValue)
+ subscribeFn(newValue,self)
}
});
<tbody id="ldap-group-mappings-tbody">
{{each(i, ldapGroupMapping) ldapGroupMappings()}}
<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>
- <div>
- <select id="roles-group-${ldapGroupMapping.group()}" data-bind="options: $parent.allRoleNames, selectedOptions: ldapGroupMapping.roleNames"
- size="5" multiple="true" ></select>
- </div>
-
+ <select id="roles-group-mapping-${ldapGroupMapping.group()}" data-bind="options: $parent.allRoleNames, selectedOptions: ldapGroupMapping.roleNames"
+ size="5" multiple="true" ></select>
</td>
</tr>
{{/each}}
</tbody>
</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>
</script>