if (permission == null || permission.length() < 1 || permission.equals("*"))
return;
Object[] args = { uicomponent.getName() };
String[] tmp = permission.split(":", 2);
if (tmp.length != 2) {
throw new MessageException(new ApplicationMessage("PermissionValidator.msg.invalid-permission-input", args));
}
String membership = tmp[0];
String groupId = tmp[1];
Group group = null;
MembershipType membershipType = null;
try {
membershipType = service.getMembershipTypeHandler().findMembershipType(membership);
group = service.getGroupHandler().findGroupById(groupId);
} catch (Exception e) {
log.error(e.getMessage(), e);
}
if (membership.equals("*")) {
if (membershipType != null && group != null)
return;
throw new MessageException(new ApplicationMessage("PermissionValidator.msg.membership-group-not-found", args));
}
if (group != null)
return;
throw new MessageException(new ApplicationMessage("PermissionValidator.msg.membership-group-not-found", args));
}