// Remark Jeen: I would only do that in the case where the subject
// was not explicitly specified in the method call. In the current
// case, the user explicitly tried to perform a remove on a specific
// subject to which he has no access rights. IMHO, that should
// _always_ result in an error.
throw new StoreException("insufficient access rights on subject " + subj.stringValue());
}
}
else {
Cursor<? extends Statement> toBeRemovedStatements = super.getStatements(null, pred, obj, false,
contexts);
try {
Statement st;
while ((st = toBeRemovedStatements.next()) != null) {
Resource subject = st.getSubject();
if (isEditable(subject)) {
super.removeStatements(subject, pred, obj, contexts);
}
else if (isViewable(subject)) {
// Since the user did not explicitly specify the subject being
// removed, we silently ignore the statement if the subject is
// not viewable by the user.
throw new StoreException("insufficient access rights on subject " + subject.stringValue());
}
}
}
finally {
toBeRemovedStatements.close();