protected String[] getStaticPortletIds(String position) {
    Layout layout = getLayout();

    String selector1 = StringPool.BLANK;

    Group group = null;

    try {
      group = layout.getGroup();
    } catch (PortalException pe) {
      _log.error("Unable to get group " + layout.getGroupId());

      return new String[0];
    }

    if (group.isUser()) {
      selector1 = LayoutTypePortletConstants.STATIC_PORTLET_USER_SELECTOR;
    } else if (group.isOrganization()) {
      selector1 = LayoutTypePortletConstants.STATIC_PORTLET_ORGANIZATION_SELECTOR;
    } else if (group.isRegularSite()) {
      selector1 = LayoutTypePortletConstants.STATIC_PORTLET_REGULAR_SITE_SELECTOR;
    }

    String selector2 = layout.getFriendlyURL();

    String[] portletIds = PropsUtil.getArray(position, new Filter(selector1, selector2));

    for (int i = 0; i < portletIds.length; i++) {
      portletIds[i] = JS.getSafeName(portletIds[i]);
    }

    return portletIds;
  }
  protected boolean isValidAssignment(KaleoTaskAssignment kaleoTaskAssignment, Group group)
      throws PortalException {

    long roleId = kaleoTaskAssignment.getAssigneeClassPK();

    Role role = _roleLocalService.getRole(roleId);

    if (role.getType() == RoleConstants.TYPE_REGULAR) {
      return true;
    } else if ((group != null)
        && group.isOrganization()
        && (role.getType() == RoleConstants.TYPE_ORGANIZATION)) {

      return true;
    } else if ((group != null) && group.isSite() && (role.getType() == RoleConstants.TYPE_SITE)) {

      return true;
    }

    return false;
  }