Revision 10176
Added by Jing Tao almost 8 years ago
src/edu/ucsb/nceas/metacat/Eml210SAXHandler.java | ||
---|---|---|
197 | 197 |
Date createDate, Date updateDate, boolean writeAccessRules, Vector<String> guidsToSync) throws SAXException { |
198 | 198 |
super(conn, action, docid, revision, user, groups, pub, serverCode, createDate, |
199 | 199 |
updateDate, writeAccessRules); |
200 |
|
|
200 |
logMetacat.info("the write access rule flag is"+writeAccessRules); |
|
201 | 201 |
this.guidsToSync = guidsToSync; |
202 | 202 |
// Get the unchangeable subtrees (user doesn't have write permission) |
203 | 203 |
try { |
... | ... | |
1979 | 1979 |
// check EITHER previous or current id for access rules |
1980 | 1980 |
// see: https://projects.ecoinformatics.org/ecoinfo/issues/5647 |
1981 | 1981 |
PermissionController previousController = new PermissionController(previousDocid); |
1982 |
PermissionController currentController = new PermissionController(accessionNumber); |
|
1983 |
if (previousController.hasPermission(user, groups, AccessControlInterface.ALLSTRING) |
|
1982 |
PermissionController currentController = new PermissionController(accessionNumber); |
|
1983 |
if(writeAccessRules) { |
|
1984 |
if (previousController.hasPermission(user, groups, AccessControlInterface.ALLSTRING) |
|
1984 | 1985 |
|| previousController.hasPermission(user, groups, AccessControlInterface.CHMODSTRING) |
1985 | 1986 |
|| currentController.hasPermission(user, groups, AccessControlInterface.ALLSTRING) |
1986 | 1987 |
|| currentController.hasPermission(user, groups, AccessControlInterface.CHMODSTRING) |
1987 | 1988 |
) { |
1988 |
onlineDataFileIdInTopAccessVector.add(guid); |
|
1989 |
} else { |
|
1990 |
throw new SAXException(UPDATEACCESSERROR+identifier+" for the data object "+previousDocid); |
|
1989 |
onlineDataFileIdInTopAccessVector.add(guid); |
|
1990 |
} else { |
|
1991 |
throw new SAXException(UPDATEACCESSERROR+identifier+" for the data object "+previousDocid); |
|
1992 |
} |
|
1991 | 1993 |
} |
1992 | 1994 |
} |
1993 | 1995 |
}// try |
Also available in: Unified diff
Check the change of the access rules on data objects only when we need to write access rules base on the access part of the eml document.