コード例 #1
0
 @SuppressWarnings("unchecked")
 @Override
 public DataModel getRoles(String... args) {
   DataModel model = new DataModel();
   model.setRows(roleServices.getRoles(args));
   return model;
 }
コード例 #2
0
  @Override
  public TreeModel getResourceOfRole(String roleId) {

    List<ResourceExtForm> r = resourceService.getResources();
    List<RoleResource> ur = roleServices.getResoucerOfRole(roleId);

    for (ResourceExtForm ref : r) {
      if (ur != null && ur.size() > 0) {
        boolean checked = false;
        for (RoleResource uref : ur) {
          if (ref.getId().equals(uref.getResourceId())) {
            ref.setChecked(true);
            checked = true;
            break;
          }
        }
        if (!checked) ref.setChecked(false);
      } else {
        ref.setChecked(false);
      }
    }
    return roleServices.generateResourceTree(r);
  }
コード例 #3
0
 @Override
 public void updateRole(RoleExtForm roleExtForm) {
   roleServices.updateRole(roleExtForm);
 }
コード例 #4
0
 @Override
 public RoleExtForm getRoleById(String roleId) {
   return roleServices.getRoleById(roleId);
 }
コード例 #5
0
 @Override
 public void deleteRole(String... roleIds) {
   roleServices.deleteRole(roleIds);
 }
コード例 #6
0
 @Override
 public void exeAssignResouces(String roleId, String[] resourceIds) {
   roleServices.exeAssignResouces(roleId, resourceIds);
 }
コード例 #7
0
 @Override
 public void addRole(RoleExtForm roleExtForm) {
   roleServices.addRole(roleExtForm);
 }