diff --git a/docs-web/src/main/java/com/sismics/docs/rest/resource/DocumentResource.java b/docs-web/src/main/java/com/sismics/docs/rest/resource/DocumentResource.java index 555e4dc5..1f7bccbc 100644 --- a/docs-web/src/main/java/com/sismics/docs/rest/resource/DocumentResource.java +++ b/docs-web/src/main/java/com/sismics/docs/rest/resource/DocumentResource.java @@ -92,7 +92,7 @@ public class DocumentResource extends BaseResource { TagDao tagDao = new TagDao(); tagDtoList = tagDao.findByCriteria( new TagCriteria() - .setTargetIdList(getTargetIdList(shareId)) + .setTargetIdList(getTargetIdList(null)) // No tags for shares .setDocumentId(documentId), new SortCriteria(1, true)); JsonArrayBuilder tags = Json.createArrayBuilder(); @@ -270,7 +270,9 @@ public class DocumentResource extends BaseResource { for (DocumentDto documentDto : paginatedList.getResultList()) { // Get tags added by the current user on this document - List tagDtoList = tagDao.findByCriteria(new TagCriteria().setTargetIdList(getTargetIdList(null)).setDocumentId(documentDto.getId()), new SortCriteria(1, true)); + List tagDtoList = tagDao.findByCriteria(new TagCriteria() + .setTargetIdList(getTargetIdList(null)) + .setDocumentId(documentDto.getId()), new SortCriteria(1, true)); JsonArrayBuilder tags = Json.createArrayBuilder(); for (TagDto tagDto : tagDtoList) { tags.add(Json.createObjectBuilder() diff --git a/docs-web/src/main/webapp/src/app/docs/controller/document/DocumentViewPermissions.js b/docs-web/src/main/webapp/src/app/docs/controller/document/DocumentViewPermissions.js index cb953fcf..453605df 100644 --- a/docs-web/src/main/webapp/src/app/docs/controller/document/DocumentViewPermissions.js +++ b/docs-web/src/main/webapp/src/app/docs/controller/document/DocumentViewPermissions.js @@ -7,7 +7,7 @@ angular.module('docs').controller('DocumentViewPermissions', function($scope) { // Watch for ACLs change and group them for easy displaying $scope.$watch('document.inherited_acls', function(acls) { $scope.inheritedAcls = _.groupBy(acls, function(acl) { - return acl.id; + return acl.source_id; }); }); }); \ No newline at end of file diff --git a/docs-web/src/main/webapp/src/partial/docs/document.view.permissions.html b/docs-web/src/main/webapp/src/partial/docs/document.view.permissions.html index 7c4401f5..701387a5 100644 --- a/docs-web/src/main/webapp/src/partial/docs/document.view.permissions.html +++ b/docs-web/src/main/webapp/src/partial/docs/document.view.permissions.html @@ -1,5 +1,14 @@

Permissions can be applied directly to this document, or can come from tags.

+
+

Permissions on this document

+ + +
+

Permissions inherited by tags

@@ -25,13 +34,4 @@ -
- -
-

Permissions on this document

- -
\ No newline at end of file diff --git a/docs-web/src/test/java/com/sismics/docs/rest/TestShareResource.java b/docs-web/src/test/java/com/sismics/docs/rest/TestShareResource.java index 959e9dd3..5dc86364 100644 --- a/docs-web/src/test/java/com/sismics/docs/rest/TestShareResource.java +++ b/docs-web/src/test/java/com/sismics/docs/rest/TestShareResource.java @@ -47,7 +47,7 @@ public class TestShareResource extends BaseJerseyTest { Assert.assertNotNull(document1Id); // Add a file - String file1Id = null; + String file1Id; try (InputStream is = Resources.getResource("file/PIA00452.jpg").openStream()) { StreamDataBodyPart streamDataBodyPart = new StreamDataBodyPart("file", is, "PIA00452.jpg"); try (FormDataMultiPart multiPart = new FormDataMultiPart()) {