Changeset 38316 for main/trunk/greenstone3
- Timestamp:
- 2023-10-16T16:23:07+13:00 (8 months ago)
- Location:
- main/trunk/greenstone3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/GS2Construct.java
r38219 r38316 339 339 String lang = request.getAttribute(GSXML.LANG_ATT); 340 340 341 boolean isAdminRemovingUserComments = false; 342 343 // Have to be admin to do remove-metadata-array for user comments meta fields 344 if (metaserver_command.equals("remove-metadata-array")) { 345 // check if only removing user comments metadata fields 346 docids = getDocIdsWithOptFilter(json_str, allowedMetaFieldsPattern); 347 if(docids != null) { 348 isAdminRemovingUserComments = true; 349 } 350 351 if(!userIsAdministrator(request, params)) { 352 isAdminRemovingUserComments = false; 353 return errorResponse("processModifyMetadata", NO_PERMISSIONS_ERROR, lang); 354 } 355 } 356 357 if(isAdminRemovingUserComments) { 358 // everything is set up already now for admin to remove user comments 359 } 360 else if (userHasCollectionEditPermissions(request, params)) { // means user can modify ANY metadata 361 341 if (userHasCollectionEditPermissions(request, params)) { // means user can modify ANY metadata 342 if (metaserver_command.equals("remove-metadata-array")) { 343 // check if only removing user comments metadata fields 344 docids = getDocIdsWithOptFilter(json_str, allowedMetaFieldsPattern); 345 if(docids == null) { 346 // removing multiple metadata that are Not user comments 347 // can be done by any user with collection edit permissions 348 docids = getDocIdsWithOptFilter(json_str, null); 349 } 350 } 362 351 // if dealing with an array of meta, then parse out the docids from the json 363 if(supportsSettingMultipleMeta) { 364 docids = getDocIdsWithOptFilter(json_str, null); 365 } else if (metaserver_command.equals("remove-metadata-array")) { 366 // removing multiple metadata that are Not user comments 367 // can be done by any user with collection edit permissions 352 else if(supportsSettingMultipleMeta) { 368 353 docids = getDocIdsWithOptFilter(json_str, null); 369 354 } // else set-meta operation on single metadata field of single doc, -
main/trunk/greenstone3/web/interfaces/default/transform/layouts/usercomments.xsl
r38188 r38316 45 45 <gsf:variable name="userCanDeleteComments"> 46 46 <xsl:choose> 47 <xsl:when test="/page/pageRequest/userInformation and (util:csvContains(/page/pageRequest/userInformation/@groups, 'administrator'))">1</xsl:when><xsl:otherwise>0</xsl:otherwise> 47 <!--<xsl:when test="/page/pageRequest/userInformation and (util:csvContains(/page/pageRequest/userInformation/@groups, 'administrator'))">1</xsl:when><xsl:otherwise>0</xsl:otherwise>--> 48 <xsl:when test="$canDoEditing = 'true'">1</xsl:when><xsl:otherwise>0</xsl:otherwise> 48 49 </xsl:choose> 49 50 </gsf:variable>
Note:
See TracChangeset
for help on using the changeset viewer.