import org.argeo.api.cms.ux.CmsView;
import org.argeo.app.ui.SuiteEvent;
import org.argeo.app.ui.SuiteIcon;
-import org.argeo.app.ui.dialogs.NewUserWizard;
import org.argeo.cms.CmsUserManager;
import org.argeo.cms.acr.ContentUtils;
import org.argeo.cms.auth.CmsRole;
import org.argeo.cms.auth.CurrentUser;
import org.argeo.cms.auth.UserAdminUtils;
import org.argeo.cms.jcr.acr.JcrContent;
-import org.argeo.cms.jface.dialog.CmsWizardDialog;
import org.argeo.cms.swt.CmsSwtTheme;
import org.argeo.cms.swt.CmsSwtUtils;
import org.argeo.cms.swt.Selected;
import org.argeo.util.naming.LdapAttrs;
import org.argeo.util.naming.LdapObjs;
import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.Wizard;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.SashForm;
import org.eclipse.swt.layout.GridData;
List<HierarchyUnit> visible = new ArrayList<>();
if (parent != null) {
for (HierarchyUnit hu : parent.getDirectHierarchyUnits(true)) {
- if (CurrentUser.implies(CmsRole.userAdmin, hu.getBase()) //
- ) // IPA
- {
- visible.add(hu);
- }
+ // if parent was visible, it is visible
+ // TODO restrict more?
+
+// if (CurrentUser.implies(CmsRole.userAdmin, hu.getBase()) //
+// ) // IPA
+// {
+ visible.add(hu);
+// }
}
} else {
for (UserDirectory directory : cmsUserManager.getUserDirectories()) {
|| CurrentUser.implies(CmsRole.userAdmin,
IpaUtils.IPA_ACCOUNTS_RDN + "," + directory.getBase())) // IPA
{
- // we do not show the base level
- for (HierarchyUnit hu : directory.getDirectHierarchyUnits(true)) {
+ // TODO show base level
+ }
+ for (HierarchyUnit hu : directory.getDirectHierarchyUnits(true)) {
+ if (CurrentUser.implies(CmsRole.userAdmin, hu.getBase())) {
visible.add(hu);
}
}
@Override
public String getText(HierarchyUnit model) {
- return model.getHierarchyUnitName();
+ return model.getHierarchyUnitLabel(CurrentUser.locale());
}
@Override
if (content.hasContentClass(LdapObjs.organization.qName()))
return SuiteIcon.organisation;
else if (content.hasContentClass(LdapObjs.posixGroup.qName()))
- return SuiteIcon.group;
+ return SuiteIcon.users;
else
- return SuiteIcon.people;
+ return SuiteIcon.addressBook;
}
};
else if (role.isContentClass(LdapObjs.inetOrgPerson.qName()))
return SuiteIcon.person;
else if (role.isContentClass(LdapObjs.organization.qName()))
- return SuiteIcon.organisation;
+ return SuiteIcon.organisationContact;
else if (role.isContentClass(LdapObjs.groupOfNames.qName()))
return SuiteIcon.group;
else
});
addItem.addSelectionListener((Selected) (e) -> {
- // SuiteUtils.getOrCreateUserNode(adminSession, userDn);
- GuidedForm wizard = new NewUserWizard(null);
+ HierarchyUnit hierarchyUnit = usersPart.getInput();
+ Content huContent = ContentUtils.hierarchyUnitToContent(contentSession, hierarchyUnit);
+ GuidedForm wizard = new NewUserForm(cmsUserManager, huContent);
SwtGuidedFormDialog dialog = new SwtGuidedFormDialog(parent.getShell(), wizard);
// WizardDialog dialog = new WizardDialog(shell, wizard);
if (dialog.open() == Window.OK) {