Bug #1527: Several interface disabling configurations modified.

* Programmed right condition to disable managing roles and profiles of a LDAP user:
     LDAP enabled and import use of LDAP roles enabled.
   * Improved informative messages when the profiles and roles cannot be
     managed in a user.
   * Corrected erroneos condition to disable the Delete icon beloning to
     an assigned role.
   * Coherent placement of the informative warning informing that password cannot
     be managed.
This commit is contained in:
Javier Moran Rua 2012-08-19 01:52:37 +02:00
parent 848a8b5c12
commit e45fe5cf63
2 changed files with 10 additions and 7 deletions

View file

@ -65,6 +65,7 @@ import org.zkoss.zul.api.Groupbox;
*
* @author Jacobo Aragunde Perez <jaragunde@igalia.com>
* @author Manuel Rego Casasnovas <rego@igalia.com>
* @author Javier Moran Rua <jmoran@igalia.com>
*/
@SuppressWarnings("serial")
public class UserCRUDController extends BaseCRUDController<User> implements
@ -184,6 +185,7 @@ public class UserCRUDController extends BaseCRUDController<User> implements
return userModel.getUsers();
}
@Override
protected void save() throws ValidationException {
userModel.confirmSave();
PasswordUtil.showOrHideDefaultPasswordWarnings();
@ -352,7 +354,7 @@ public class UserCRUDController extends BaseCRUDController<User> implements
removeRole(role);
}
});
removeButton.setDisabled(getLdapUserRolesLdapConfiguration()
removeButton.setDisabled(areRolesAndProfilesDisabled()
|| role.equals(UserRole.ROLE_BOUND_USER)
|| isUserDefaultAdmin());
row.appendChild(removeButton);
@ -452,7 +454,8 @@ public class UserCRUDController extends BaseCRUDController<User> implements
}
public boolean areRolesAndProfilesDisabled() {
return isLdapUserLdapConfiguration() || isUserDefaultAdmin();
return (isLdapUser() && userModel.isLDAPBeingUsed() && userModel
.isLDAPRolesBeingUsed()) || isUserDefaultAdmin();
}
public boolean isLdapUserOrDefaultAdmin() {

View file

@ -32,11 +32,11 @@
<vbox>
<!-- User details -->
<vbox>
<label value="${i18n:_('Password cannot be managed for LDAP users because LDAP authentication is being used')}" visible="@{controller.ldapUserLdapConfiguration}" />
</vbox>
<groupbox closable="false">
<caption label="${i18n:_('General user data')}" />
<vbox>
<label value="${i18n:_('Password cannot be managed for LDAP users because LDAP authentication is enabled.')}" visible="@{controller.ldapUserLdapConfiguration}" />
</vbox>
<grid fixedLayout="false" span="true">
<columns>
<column width="200px" />
@ -125,7 +125,7 @@
<groupbox closable="false">
<caption label="${i18n:_('Association with roles')}" />
<vbox>
<label value="${i18n:_('Roles of LDAP users cannot be managed because LDAP roles are being used.')}" visible="@{controller.ldapUserRolesLdapConfiguration}" />
<label value="${i18n:_('Roles of LDAP users cannot be managed because LDAP is enabled and LDAP roles are being used.')}" visible="@{controller.areRolesAndProfilesDisabled}" />
</vbox>
<hbox align="center">
<combobox id="userRolesCombo" autodrop="true" />
@ -146,7 +146,7 @@
<groupbox closable="false">
<caption label="${i18n:_('Association with profiles')}" />
<vbox>
<label value="${i18n:_('Profiles of LDAP users cannot be managed because LDAP roles are being used.')}" visible="@{controller.ldapUserRolesLdapConfiguration}" />
<label value="${i18n:_('Profiles of LDAP users cannot be managed because LDAP is enabled and LDAP roles are being used.')}" visible="@{controller.areRolesAndProfilesDisabled}" />
</vbox>
<hbox align="center">
<combobox id="profilesCombo" autodrop="true" />