Project

General

Profile

« Previous | Next » 

Revision 6686

Added by Jing Tao almost 13 years ago

When read a FGDC document, Metacat will add a new parameter enableFGDCediting params for the xml transforming.

View differences:

src/edu/ucsb/nceas/metacat/MetacatHandler.java
151 151
    private static final String SUCCESSCLOSE = "</success>";
152 152
    private static final String ERROR = "<error>";
153 153
    private static final String ERRORCLOSE = "</error>";
154
    public static final String FGDCDOCTYPE = "metadata";
154 155
    
155 156
	private Timer timer;
156 157
	
......
1371 1372
                            params.put("publicRead", new String[] {"false"});
1372 1373
                    }
1373 1374
                    
1375
                    if(doc.getDoctype() != null && doc.getDoctype().equals(FGDCDOCTYPE)) {
1376
                      //for fgdc doctype, we need to pass parameter enableFGDCediting
1377
                      PermissionController controller = new PermissionController(docid);
1378
                      if(controller.hasPermission(user, groups, AccessControlInterface.WRITESTRING)) {
1379
                        params.put("enableFGDCediting", new String[] {"true"});
1380
                      } else {
1381
                        params.put("enableFGDCediting", new String[] {"false"});
1382
                      }
1383
                    }
1374 1384
                    if (response != null) {
1375 1385
                        response.setContentType("text/html"); //MIME type
1376 1386
                    }

Also available in: Unified diff