ModelConfig modelConfig = conceptConfig.getContextModelConfig();
if (modelConfig.isLogin()) {
if (!appSession.isMemberLoggedIn()) {
allowed = false;
} else {
Member loggedInMember = appSession.getLoggedInMember();
if (!loggedInMember.getRole().equals("admin")) {
if (loggedInMember.getRole().equals("manager")) {
if (action.equals("remove")
&& !conceptConfig.isRemove()) {
allowed = false;
}
} else {
String loginConcept = modelConfig.getLoginConcept();
if (conceptConfig.getCode().equals(loginConcept)) {
Member currentMember = (Member) entity;
if (currentMember != null
&& !loggedInMember.getCode().equals(
currentMember.getCode())) {
allowed = false;
}
} else if (action.equals("add")
&& !conceptConfig.isAdd()) {
allowed = false;