Closes #509: guest users cannot share and unshare

This commit is contained in:
bgamard
2021-01-21 17:58:36 +01:00
parent 1e0f8e2484
commit a6cbacae72
4 changed files with 12 additions and 8 deletions
@@ -55,7 +55,7 @@ public class ShareResource extends BaseResource {
public Response add(
@FormParam("id") String documentId,
@FormParam("name") String name) {
if (!authenticate()) {
if (!authenticate() || principal.isGuest()) {
throw new ForbiddenClientException();
}
@@ -119,7 +119,7 @@ public class ShareResource extends BaseResource {
@Path("{id: [a-z0-9\\-]+}")
public Response delete(
@PathParam("id") String id) {
if (!authenticate()) {
if (!authenticate() || principal.isGuest()) {
throw new ForbiddenClientException();
}