Project

General

Profile

« Previous | Next » 

Revision 6450

treat access rules atomically - do not group them together otherwise the intent is subverted

View differences:

src/edu/ucsb/nceas/metacat/IdentifierManager.java
1277 1277
     * @throws AccessException
1278 1278
     */
1279 1279
    private AccessPolicy getAccessPolicy(String guid) throws McdbDocNotFoundException, AccessException {
1280
        AccessPolicy accessPolicy = new AccessPolicy();
1281

  
1280 1282
    	// use GUID to look up the access
1281 1283
        XMLAccessAccess accessController  = new XMLAccessAccess(true);
1282 1284
    	List<XMLAccessDAO> accessDAOs = accessController.getXMLAccessForDoc(guid);
1283
    	AccessRule accessRule = new AccessRule();    	
1284 1285
        for (XMLAccessDAO accessDAO: accessDAOs) {
1286
        	AccessRule accessRule = new AccessRule();    	
1285 1287
        	Permission permission = convertPermission(accessDAO.getPermission().intValue());
1286 1288
        	accessRule.addPermission(permission);
1287 1289
        	Subject subject = new Subject();
1288 1290
        	subject.setValue(accessDAO.getPrincipalName());
1289 1291
        	accessRule.addSubject(subject);
1292
            accessPolicy.addAllow(accessRule);
1290 1293
        }
1291
        AccessPolicy accessPolicy = new AccessPolicy();
1292
        accessPolicy.addAllow(accessRule);
1293 1294
        return accessPolicy;
1294 1295
    }
1295 1296
    

Also available in: Unified diff