/** * {@inheritDoc} * * @see org.xwiki.bridge.DocumentAccessBridge#isDocumentViewable(org.xwiki.model.reference.DocumentReference) */ public boolean isDocumentViewable(DocumentReference documentReference) { return hasRight(documentReference, "view"); }
/** * {@inheritDoc} * * @see DocumentAccessBridge#isDocumentEditable(org.xwiki.model.reference.DocumentReference) */ public boolean isDocumentEditable(DocumentReference documentReference) { return hasRight(documentReference, "edit"); }
/** * {@inheritDoc} * * @see org.xwiki.bridge.DocumentAccessBridge#isDocumentViewable(java.lang.String) */ @Deprecated public boolean isDocumentViewable(String documentReference) { return hasRight(documentReference, "view"); }
/** * {@inheritDoc} * * @see DocumentAccessBridge#isDocumentEditable(String) */ @Deprecated public boolean isDocumentEditable(String documentReference) { return hasRight(documentReference, "edit"); }
/** * Utility method for checking access rights of the current user on a target document. * * @param documentReference the reference of the document * @param right Access right requested. * @return True if the current user has the given access right, false otherwise. */ private boolean hasRight(DocumentReference documentReference, String right) { return hasRight(this.entityReferenceSerializer.serialize(documentReference), right); }