private void checkGroupPermission(Forum forum) { if (!ForumRepository.isForumAccessible(forum.getId())) { throw new AccessViolationException(String.valueOf(forum.getId())); } }
private void checkGroupAdministrationPermission(Forum forum) { if (!SessionFacade.getUserSession().isAdmin(forum.getId())) { throw new AccessViolationException(String.valueOf(forum.getId())); } }
private void validateWriteRights(String id) { UserProfile userProfile = this.userBusinessService.getCurrentUserProfile(); if (userProfile == null || !contentEditorService.hasAccessRights(userProfile.getId(), id)) { throw new AccessViolationException(id); } }
private void checkGroupModerationPermission(Forum forum) { if (!SessionFacade.getUserSession().isModerator(forum.getId())) { throw new AccessViolationException(String.valueOf(forum.getId())); } }
private void checkGroupJoinBanlist(Forum forum, UserId executorId) { ForumBanlistDAO banlistDao = DataAccessDriver.getInstance().newForumBanlistDAO(); if (banlistDao.isUserOnBanlistForForumJoin(forum.getId(), executorId)) { throw new AccessViolationException(String.valueOf(forum.getId())); } }
@Override public CollectionData getCollection(final String collectionId) { UserProfile userProfile = userBusinessService.getCurrentUserProfile(); String userId = null; if (userProfile != null) { userId = userProfile.getId(); } if (!collectionService.validateHasRights(collectionId, userId)) { throw new AccessViolationException(collectionId); } return collectionService.fetchCollection(collectionId); }
private void checkGroupModerationOrPostCreatorPermission(Forum forum, Post post, UserId userId) { if (!SessionFacade.getUserSession().isModerator(forum.getId()) && !userId.equals(post.getUserId())) { throw new AccessViolationException(String.valueOf(forum.getId())); } }
private void checkGroupModerationOrThreadCreatorPermission(Forum forum, Topic topic, UserId userId) { if (!SessionFacade.getUserSession().isModerator(forum.getId()) && !userId.equals(topic.getPostedBy().getId())) { throw new AccessViolationException(String.valueOf(forum.getId())); } }
private ElementContent fetchLicensedContent(final String objectId, final String contentPath, final ElementMetadata elementMetadata) { ElementLicenseResponse response = licenseResolver.fetchContentLicense(elementMetadata); switch (response.getAvailability()) { case AVAILABLE: ElementContent content = repositoryFacade.fetchContent(objectId, contentPath); auditServiceFacade.addDownload(elementMetadata, response, content.getContentType()); return content; default: } throw new AccessViolationException(objectId); }
@Override public ElementMetadata fetchElementMetadata(final String objectId) { ElementMetadata elementMetadata = repositoryFacade.fetchElementMetadata(objectId); ElementLicenseResponse response = licenseResolver.fetchMetadataLicense(elementMetadata); if (response.getAvailability() != ContentAvaiability.AVAILABLE) { throw new AccessViolationException(objectId); } if(metadataPostProcessors != null){ for(ElementMetadataPostProcessor postProcessor:metadataPostProcessors){ if(postProcessor.shouldProcess(elementMetadata)){ elementMetadata = postProcessor.postProcess(elementMetadata); } } } return elementMetadata; }
throw new AccessViolationException(String.valueOf(forumId));
throw new AccessViolationException(String.valueOf(forumId)); throw new AccessViolationException(String.valueOf(forumId)); throw new AccessViolationException(String.valueOf(forumId));
throw new AccessViolationException(groupId); throw new AccessViolationException(String.valueOf(forumId));