예제 #1
0
  /**
   * 删除动作
   *
   * @param ids
   * @return
   */
  public boolean delete(Long[] ids, Map<String, Object> context) {
    for (Long id : ids) {
      Weight w = OverrideUtils.overrideToWeight(overrideService.findById(id));
      if (!super.currentUser.hasServicePrivilege(w.getService())) {
        context.put("message", getMessage("HaveNoServicePrivilege", w.getService()));
        return false;
      }
    }

    for (Long id : ids) {
      overrideService.deleteOverride(id);
    }
    return true;
  }
예제 #2
0
 /**
  * load weight对象供编辑操作
  *
  * @param id
  * @param context
  */
 public void show(Long id, Map<String, Object> context) {
   Weight weight = OverrideUtils.overrideToWeight(overrideService.findById(id));
   context.put("weight", weight);
 }