return role "PAC_ADMIN_DW" or "PAC_ADMIN_SW" for webclient
This commit is contained in:
parent
651a2f1c20
commit
95c92273e9
@ -286,4 +286,9 @@ public class Pac extends AbstractEntity implements Serializable {
|
|||||||
return multi.getQuantity();
|
return multi.getQuantity();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isDynamic() {
|
||||||
|
String basepacName = getBasepac().getName();
|
||||||
|
return PAC_DW.equals(basepacName) || PAC_WEB.equals(basepacName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,11 @@ public class RoleRemote implements IRemote {
|
|||||||
role = "HOSTMASTER";
|
role = "HOSTMASTER";
|
||||||
}
|
}
|
||||||
if (user.equals(pacName)) {
|
if (user.equals(pacName)) {
|
||||||
role = "PAC_ADMIN";
|
if (pac.isDynamic()) {
|
||||||
|
role = "PAC_ADMIN_DW";
|
||||||
|
} else {
|
||||||
|
role = "PAC_ADMIN_SW";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (role.equals("USER")) {
|
if (role.equals("USER")) {
|
||||||
GenericModuleImpl module = new GenericModuleImpl(transaction);
|
GenericModuleImpl module = new GenericModuleImpl(transaction);
|
||||||
|
@ -45,7 +45,7 @@ public class RoleTest {
|
|||||||
Object[] result = (Object[]) execute;
|
Object[] result = (Object[]) execute;
|
||||||
assertTrue(result.length == 1);
|
assertTrue(result.length == 1);
|
||||||
String role = (String) ((Map<?, ?>) result[0]).get("role");
|
String role = (String) ((Map<?, ?>) result[0]).get("role");
|
||||||
assertEquals("PAC_ADMIN", role);
|
assertEquals("PAC_ADMIN_DW", role);
|
||||||
} catch (XmlRpcException e) {
|
} catch (XmlRpcException e) {
|
||||||
fail(e.getMessage());
|
fail(e.getMessage());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user