/** * Adds the information which roles can read permission the given element to the document. This information will later be used by the permission script to * filter out document which should not be visible to the user which invokes the query. * * @param document * @param element */ protected void addPermissionInfo(JsonObject document, MeshCoreVertex<?, ?> element) { Iterable<? extends Role> roleIt = element.getRolesWithPerm(GraphPermission.READ_PERM); List<String> roleUuids = new ArrayList<>(); for (Role role : roleIt) { roleUuids.add(role.getUuid()); } document.put("_roleUuids", roleUuids); }