Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.Set;

Expand Down Expand Up @@ -75,7 +76,7 @@ public class MetadataIndexApi {
method = RequestMethod.GET,
produces = MediaType.APPLICATION_JSON_VALUE
)
@PreAuthorize("hasAuthority('Administrator')")
@PreAuthorize("hasAuthority('Editor')")
@ResponseStatus(HttpStatus.OK)
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "Record indexed."),
Expand All @@ -96,6 +97,8 @@ IndexResponse index(
required = false
)
String bucket,
@Parameter(hidden = true)
HttpServletRequest request,
@Parameter(hidden = true)
HttpSession httpSession
)
Expand All @@ -108,6 +111,7 @@ IndexResponse index(
int index = 0;

for (String uuid : records) {
ApiUtils.canEditRecord(uuid, request);
try {
metadataUtils.findAllByUuid(uuid).forEach(m -> ids.add(m.getId()));
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,11 @@
<span data-translate="">duplicate</span>
</a>
</li>
<li class="divider" data-ng-if="user.isAdministrator()" role="menuitem"></li>
<li class="divider" data-ng-if="user.canEditRecord(md)" role="menuitem"></li>
<li role="menuitem">
<a
data-ng-click="mdService.indexMd(md)"
data-ng-if="user.isAdministrator()"
data-ng-if="user.canEditRecord(md)"
href=""
>
<span class="fa fa-fw fa-cogs"></span>&nbsp;
Expand Down
Loading