public void updateAsset(
      long userId, TasksEntry tasksEntry, long[] assetCategoryIds, String[] assetTagNames)
      throws PortalException, SystemException {

    AssetEntryLocalServiceUtil.updateEntry(
        userId,
        tasksEntry.getGroupId(),
        TasksEntry.class.getName(),
        tasksEntry.getTasksEntryId(),
        assetCategoryIds,
        assetTagNames);
  }
  @Override
  public void deleteTasksEntry(TasksEntry tasksEntry) throws PortalException, SystemException {

    // Tasks entry

    tasksEntryPersistence.remove(tasksEntry);

    // Asset

    AssetEntryLocalServiceUtil.deleteEntry(
        TasksEntry.class.getName(), tasksEntry.getTasksEntryId());

    // Message boards

    MBMessageLocalServiceUtil.deleteDiscussionMessages(
        TasksEntry.class.getName(), tasksEntry.getTasksEntryId());

    // Social

    SocialActivityLocalServiceUtil.deleteActivities(
        TasksEntry.class.getName(), tasksEntry.getTasksEntryId());
  }
  public static boolean contains(
      PermissionChecker permissionChecker, TasksEntry tasksEntry, String actionId) {

    if (permissionChecker.getUserId() == tasksEntry.getAssigneeUserId()) {
      return true;
    }

    if (permissionChecker.hasOwnerPermission(
        tasksEntry.getCompanyId(),
        TasksEntry.class.getName(),
        tasksEntry.getTasksEntryId(),
        tasksEntry.getUserId(),
        actionId)) {

      return true;
    }

    return permissionChecker.hasPermission(
        tasksEntry.getGroupId(),
        TasksEntry.class.getName(),
        tasksEntry.getTasksEntryId(),
        actionId);
  }