diff --git a/hsarback/src/de/hsadmin/mods/pac/Pac.java b/hsarback/src/de/hsadmin/mods/pac/Pac.java index 7536363..23fa538 100644 --- a/hsarback/src/de/hsadmin/mods/pac/Pac.java +++ b/hsarback/src/de/hsadmin/mods/pac/Pac.java @@ -286,4 +286,9 @@ public class Pac extends AbstractEntity implements Serializable { return multi.getQuantity(); } } + + public boolean isDynamic() { + String basepacName = getBasepac().getName(); + return PAC_DW.equals(basepacName) || PAC_WEB.equals(basepacName); + } } diff --git a/hsarback/src/de/hsadmin/remote/RoleRemote.java b/hsarback/src/de/hsadmin/remote/RoleRemote.java index 6b3cd70..7d74ac4 100644 --- a/hsarback/src/de/hsadmin/remote/RoleRemote.java +++ b/hsarback/src/de/hsadmin/remote/RoleRemote.java @@ -34,7 +34,11 @@ public class RoleRemote implements IRemote { role = "HOSTMASTER"; } if (user.equals(pacName)) { - role = "PAC_ADMIN"; + if (pac.isDynamic()) { + role = "PAC_ADMIN_DW"; + } else { + role = "PAC_ADMIN_SW"; + } } if (role.equals("USER")) { GenericModuleImpl module = new GenericModuleImpl(transaction); diff --git a/hsarback/test/de/hsadmin/remote/RoleTest.java b/hsarback/test/de/hsadmin/remote/RoleTest.java index 7f114f7..0236509 100644 --- a/hsarback/test/de/hsadmin/remote/RoleTest.java +++ b/hsarback/test/de/hsadmin/remote/RoleTest.java @@ -45,7 +45,7 @@ public class RoleTest { Object[] result = (Object[]) execute; assertTrue(result.length == 1); String role = (String) ((Map) result[0]).get("role"); - assertEquals("PAC_ADMIN", role); + assertEquals("PAC_ADMIN_DW", role); } catch (XmlRpcException e) { fail(e.getMessage()); }