[
https://issues.apache.org/jira/browse/RYA-119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15703522#comment-15703522
]
ASF GitHub Bot commented on RYA-119:
------------------------------------
Github user isper3at commented on a diff in the pull request:
https://github.com/apache/incubator-rya/pull/124#discussion_r89897518
--- Diff:
dao/mongodb.rya/src/main/java/org/apache/rya/mongodb/MongoDBRyaDAO.java ---
@@ -164,26 +174,31 @@ public void add(final Iterator<RyaStatement>
statement) throws RyaDAOException {
final List<DBObject> dbInserts = new ArrayList<DBObject>();
while (statement.hasNext()){
final RyaStatement ryaStatement = statement.next();
- final DBObject insert =
storageStrategy.serialize(ryaStatement);
- dbInserts.add(insert);
-
- try {
- for (final RyaSecondaryIndexer index : secondaryIndexers) {
- index.storeStatement(ryaStatement);
+ final boolean canAdd =
DocumentVisibilityUtil.doesUserHaveDocumentAccess(auths,
ryaStatement.getColumnVisibility());
+ if (canAdd) {
+ final DBObject insert =
storageStrategy.serialize(ryaStatement);
+ dbInserts.add(insert);
+
+ try {
+ for (final RyaSecondaryIndexer index :
secondaryIndexers) {
+ index.storeStatement(ryaStatement);
+ }
+ } catch (final IOException e) {
+ log.error("Failed to add: " + ryaStatement.toString()
+ " to the indexer");
}
- } catch (final IOException e) {
- log.error("Failed to add: " + ryaStatement.toString() + "
to the indexer");
}
-
}
coll.insert(dbInserts, new InsertOptions().continueOnError(true));
}
@Override
public void delete(final RyaStatement statement, final
MongoDBRdfConfiguration conf)
throws RyaDAOException {
- final DBObject obj = storageStrategy.getQuery(statement);
- coll.remove(obj);
+ final boolean canDelete =
DocumentVisibilityUtil.doesUserHaveDocumentAccess(auths,
statement.getColumnVisibility());
+ if (canDelete) {
+ final DBObject obj = storageStrategy.getQuery(statement);
+ coll.remove(obj);
--- End diff --
I think @dlotts added some code here for removing statements from the
indexers. make sure that doesn't get erased here.
> Add visibility support to MongoDB
> ---------------------------------
>
> Key: RYA-119
> URL: https://issues.apache.org/jira/browse/RYA-119
> Project: Rya
> Issue Type: Improvement
> Components: dao
> Affects Versions: 3.2.10
> Reporter: Andrew Smith
> Assignee: Eric White
>
> Currently, when querying mongo, visibility is ignored. Need to add support
> for visibility when querying mongo.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)