Project

General

Profile

« Previous | Next » 

Revision 9178

Added by Jing Tao about 9 years ago

Add the code to check the authorization of the client which is reindexing a pid.

View differences:

src/edu/ucsb/nceas/metacat/MetacatHandler.java
2668 2668
            
2669 2669
            // TODO: Check that the user is allowed to reindex this object, allow everyone for open annotations
2670 2670
            boolean isAuthorized = true;
2671
   			//String docid = IdentifierManager.getInstance().getLocalId(pid[0]);
2672
			//isAuthorized = DocumentImpl.hasWritePermission(username, groups, docid);
2673
			//isAuthorized = AuthUtil.isAdministrator(username, groups);
2671
   			String docid = IdentifierManager.getInstance().getLocalId(pid[0]);
2672
			isAuthorized = DocumentImpl.hasWritePermission(username, groups, docid);
2673
			if(!isAuthorized) {
2674
			    isAuthorized = AuthUtil.isAdministrator(username, groups);
2675
			}
2676
			
2674 2677

  
2675 2678
            if (!isAuthorized) {
2676 2679
                out.print("<error>");

Also available in: Unified diff