Adapt to changes in Argeo Commons
[gpl/argeo-suite.git] / swt / org.argeo.app.ui / src / org / argeo / app / ui / people / PersonUiProvider.java
index a658898ffa17ac0a5da151816130fb1c2ca9ba17..780512e7aef7a86a541dc4bf6ee3cd0f2c27ac8f 100644 (file)
@@ -14,7 +14,7 @@ import org.argeo.api.cms.directory.CmsUserManager;
 import org.argeo.api.cms.directory.HierarchyUnit;
 import org.argeo.api.cms.directory.HierarchyUnit.Type;
 import org.argeo.app.api.SuiteRole;
-import org.argeo.app.ui.SuiteUiUtils;
+import org.argeo.app.swt.ux.SuiteSwtUtils;
 import org.argeo.app.ux.SuiteMsg;
 import org.argeo.app.ux.SuiteStyle;
 import org.argeo.cms.CmsMsg;
@@ -22,7 +22,7 @@ import org.argeo.cms.CurrentUser;
 import org.argeo.cms.Localized;
 import org.argeo.cms.RoleNameUtils;
 import org.argeo.cms.SystemRole;
-import org.argeo.cms.auth.CmsRole;
+import org.argeo.cms.auth.CmsSystemRole;
 import org.argeo.cms.swt.CmsSwtUtils;
 import org.argeo.cms.swt.Selected;
 import org.argeo.cms.swt.acr.SwtSection;
@@ -77,7 +77,7 @@ public class PersonUiProvider implements SwtUiProvider {
                                                roleContext, roles);
                                addRoleCheckBox(rolesSection, hierarchyUnit, user, SuiteMsg.publisherRole, SuiteRole.publisher,
                                                roleContext, roles);
-                               addRoleCheckBox(rolesSection, hierarchyUnit, user, SuiteMsg.userAdminRole, CmsRole.userAdmin,
+                               addRoleCheckBox(rolesSection, hierarchyUnit, user, SuiteMsg.userAdminRole, CmsSystemRole.userAdmin,
                                                roleContext, roles);
                        }
 //                     Composite facetsSection = new Composite(main, SWT.NONE);
@@ -89,18 +89,18 @@ public class PersonUiProvider implements SwtUiProvider {
 //                                     new Label(facetsSection, SWT.NONE).setText(member);
 //                             }
 //                     }
-                       if (CurrentUser.implies(CmsRole.userAdmin, roleContext)) {
+                       if (CurrentUser.implies(CmsSystemRole.userAdmin, roleContext)) {
                                SwtSection changePasswordSection = new SwtSection(main, SWT.BORDER);
                                changePasswordSection.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1));
                                changePasswordSection.setLayout(new GridLayout(2, false));
 //                             SuiteUiUtils.addFormLabel(changePasswordSection, CmsMsg.changePassword)
 //                                             .setLayoutData(new GridData(SWT.LEAD, SWT.CENTER, false, false, 2, 1));
-                               SuiteUiUtils.addFormLabel(changePasswordSection, CmsMsg.newPassword);
-                               Text newPasswordT = SuiteUiUtils.addFormTextField(changePasswordSection, null, null,
+                               SuiteSwtUtils.addFormLabel(changePasswordSection, CmsMsg.newPassword);
+                               Text newPasswordT = SuiteSwtUtils.addFormTextField(changePasswordSection, null, null,
                                                SWT.PASSWORD | SWT.BORDER);
                                newPasswordT.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
-                               SuiteUiUtils.addFormLabel(changePasswordSection, CmsMsg.repeatNewPassword);
-                               Text repeatNewPasswordT = SuiteUiUtils.addFormTextField(changePasswordSection, null, null,
+                               SuiteSwtUtils.addFormLabel(changePasswordSection, CmsMsg.repeatNewPassword);
+                               Text repeatNewPasswordT = SuiteSwtUtils.addFormTextField(changePasswordSection, null, null,
                                                SWT.PASSWORD | SWT.BORDER);
                                repeatNewPasswordT.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
                                Button apply = new Button(changePasswordSection, SWT.FLAT);
@@ -127,7 +127,7 @@ public class PersonUiProvider implements SwtUiProvider {
        }
 
        private void addFormLine(SwtSection parent, Localized msg, Content content, QNamed attr) {
-               SuiteUiUtils.addFormLabel(parent, msg.lead());
+               SuiteSwtUtils.addFormLabel(parent, msg.lead());
                EditableText text = new EditableText(parent, SWT.SINGLE | SWT.FLAT);
                text.setLayoutData(CmsSwtUtils.fillWidth());
                text.setStyle(SuiteStyle.simpleInput);
@@ -177,15 +177,15 @@ public class PersonUiProvider implements SwtUiProvider {
                        }
                }
 
-               if (systemRole.equals(CmsRole.userAdmin)) {
-                       if (!CurrentUser.isUserContext(roleContext) && CurrentUser.implies(CmsRole.userAdmin, roleContext)) {
+               if (systemRole.equals(CmsSystemRole.userAdmin)) {
+                       if (!CurrentUser.isUserContext(roleContext) && CurrentUser.implies(CmsSystemRole.userAdmin, roleContext)) {
                                // a user admin cannot modify the user admins of their own context
                                radio.setEnabled(true);
                        } else {
                                radio.setEnabled(false);
                        }
                } else {
-                       radio.setEnabled(CurrentUser.implies(CmsRole.userAdmin, roleContext));
+                       radio.setEnabled(CurrentUser.implies(CmsSystemRole.userAdmin, roleContext));
                }
 
                radio.addSelectionListener((Selected) (e) -> {