final List<ObjectAction> actions, final Context context, final String targetObjectId) {
final List<Component> menuItems = new ArrayList<Component>();
for (int j = 0; j < actions.size(); j++) {
final ObjectAction action = actions.get(j);
final String name = action.getName();
Component menuItem = null;
if (action.getActions().size() > 0) {
final Component[] components = createMenu(name, target, action.getActions(), context, targetObjectId);
menuItem = context.getComponentFactory().createSubmenu(name, components);
} else {
if (!action.isVisible(IsisContext.getAuthenticationSession(), target).isAllowed()) {