public void mergeTags(long fromTagId, long toTagId, boolean overrideProperties)
      throws PortalException, SystemException {

    AssetTagPermission.check(getPermissionChecker(), fromTagId, ActionKeys.VIEW);

    AssetTagPermission.check(getPermissionChecker(), toTagId, ActionKeys.UPDATE);

    assetTagLocalService.mergeTags(fromTagId, toTagId, overrideProperties);
  }
  public void deleteTags(long[] tagIds) throws PortalException, SystemException {

    for (long tagId : tagIds) {
      AssetTagPermission.check(getPermissionChecker(), tagId, ActionKeys.DELETE);

      assetTagLocalService.deleteTag(tagId);
    }
  }
  public AssetTag updateTag(
      long tagId, String name, String[] tagProperties, ServiceContext serviceContext)
      throws PortalException, SystemException {

    AssetTagPermission.check(getPermissionChecker(), tagId, ActionKeys.UPDATE);

    return assetTagLocalService.updateTag(getUserId(), tagId, name, tagProperties, serviceContext);
  }
  protected List<AssetTag> filterTags(List<AssetTag> tags) throws PortalException {

    PermissionChecker permissionChecker = getPermissionChecker();

    tags = ListUtil.copy(tags);

    Iterator<AssetTag> itr = tags.iterator();

    while (itr.hasNext()) {
      AssetTag tag = itr.next();

      if (!AssetTagPermission.contains(permissionChecker, tag, ActionKeys.VIEW)) {

        itr.remove();
      }
    }

    return tags;
  }
  public AssetTag getTag(long tagId) throws PortalException, SystemException {
    AssetTagPermission.check(getPermissionChecker(), tagId, ActionKeys.VIEW);

    return assetTagLocalService.getTag(tagId);
  }