class SoapDocumentService extends AbstractService implements DocumentService {

	@Override
	public void setPassword(String sid, long docId, String password) throws Exception {
		User user = validateSession(sid);
		DocumentDAO dao = (DocumentDAO) Context.get().getBean(DocumentDAO.class);
		Document doc = dao.findById(docId);

		checkPermission(Permission.PASSWORD, user, doc.getFolder().getId());

		doc = dao.findDocument(docId);

		Session session = SessionManager.get().get(sid);

		// Create the document history event
		DocumentHistory transaction = new DocumentHistory();
		transaction.setSession(session);
		transaction.setComment("");

		dao.setPassword(doc.getId(), password, transaction);
	}

}