@Test(expected = AuthorizationException.class) public void testDeleteAsset_notPermitted() { when(contentPermissionChecker.isPermitted("maven-releases", "maven2", BreadActions.DELETE, variableSource)) .thenReturn(false); underTest.deleteAsset(mavenReleases, assetOne); }
@Override public Set<String> deleteAsset(final Repository repository, final Asset asset) { checkNotNull(repository); checkNotNull(asset); if (!canDeleteAsset(repository, asset)) { throw new AuthorizationException(); } return getComponentMaintenanceFacet(repository).deleteAsset(asset.getEntityMetadata().getId()); }
MaintenanceServiceImpl implements MaintenanceService { @Override public Set<String> deleteAsset(final Repository repository, final Asset asset) { checkNotNull(repository); checkNotNull(asset); if (!canDeleteAsset(repository, asset)) { throw new AuthorizationException(); } return getComponentMaintenanceFacet(repository).deleteAsset(asset.getEntityMetadata().getId()); } }
MaintenanceServiceImpl implements MaintenanceService { @Override public Set<String> deleteAsset(final Repository repository, final Asset asset) { checkNotNull(repository); checkNotNull(asset); if (!canDeleteAsset(repository, asset)) { throw new AuthorizationException(); } return getComponentMaintenanceFacet(repository).deleteAsset(asset.getEntityMetadata().getId()); } @Inject  MaintenanceServiceImpl(final ContentPermissionChecker contentPermissionChecker,
                                final VariableResolverAdapterManager variableResolverAdapterManager,
                                final DeleteFolderService deleteFolderService,
                                final RepositoryPermissionChecker repositoryPermissionChecker); }
MaintenanceServiceImpl implements MaintenanceService { @Override public Set<String> deleteAsset(final Repository repository, final Asset asset) { checkNotNull(repository); checkNotNull(asset); if (!canDeleteAsset(repository, asset)) { throw new AuthorizationException(); } return getComponentMaintenanceFacet(repository).deleteAsset(asset.getEntityMetadata().getId()); } @Inject  MaintenanceServiceImpl(final ContentPermissionChecker contentPermissionChecker,
                                final VariableResolverAdapterManager variableResolverAdapterManager,
                                final DeleteFolderService deleteFolderService,
                                final RepositoryPermissionChecker repositoryPermissionChecker); @Override Set<String> deleteAsset(final Repository repository, final Asset asset); @Override Set<String> deleteComponent(final Repository repository, final Component component); @Override void deleteFolder(final Repository repository, final String path); @Override boolean canDeleteComponent(final Repository repository, final Component component); @Override boolean canDeleteAsset(final Repository repository,
                                final Asset asset); @Override boolean canDeleteFolder(final Repository repository,
                                 final String folder); }
MaintenanceServiceImpl implements MaintenanceService { @Override public Set<String> deleteAsset(final Repository repository, final Asset asset) { checkNotNull(repository); checkNotNull(asset); if (!canDeleteAsset(repository, asset)) { throw new AuthorizationException(); } return getComponentMaintenanceFacet(repository).deleteAsset(asset.getEntityMetadata().getId()); } @Inject  MaintenanceServiceImpl(final ContentPermissionChecker contentPermissionChecker,
                                final VariableResolverAdapterManager variableResolverAdapterManager,
                                final DeleteFolderService deleteFolderService,
                                final RepositoryPermissionChecker repositoryPermissionChecker); @Override Set<String> deleteAsset(final Repository repository, final Asset asset); @Override Set<String> deleteComponent(final Repository repository, final Component component); @Override void deleteFolder(final Repository repository, final String path); @Override boolean canDeleteComponent(final Repository repository, final Component component); @Override boolean canDeleteAsset(final Repository repository,
                                final Asset asset); @Override boolean canDeleteFolder(final Repository repository,
                                 final String folder);  }