mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-06 21:00:22 +00:00
Merge pull request #5694 from rcordovano/6028-restrict-adding-hashsets-to-cr
6028 Restrict ability to add hash sets to CR
This commit is contained in:
commit
e8e05d634e
@ -82,6 +82,16 @@ final public class FeatureAccessUtils {
|
||||
return currentCaseIsSingleUserCase() || multiUserCaseRestrictionsFileAbsent();
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether or not a user can add hash sets to the central
|
||||
* repository.
|
||||
*
|
||||
* @return True or false.
|
||||
*/
|
||||
public static boolean canAddHashSetsToCentralRepo() {
|
||||
return multiUserCaseRestrictionsFileAbsent();
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether or not the current case is a single-user case.
|
||||
*
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2013-2018 Basis Technology Corp.
|
||||
* Copyright 2013-2020 Basis Technology Corp.
|
||||
* Contact: carrier <at> sleuthkit <dot> org
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@ -44,6 +44,7 @@ import org.sleuthkit.autopsy.modules.hashdatabase.HashDbManager.HashDbManagerExc
|
||||
import org.sleuthkit.datamodel.TskData;
|
||||
import org.sleuthkit.datamodel.TskCoreException;
|
||||
import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepository;
|
||||
import org.sleuthkit.autopsy.featureaccess.FeatureAccessUtils;
|
||||
|
||||
/**
|
||||
* Instances of this class allow a user to create a new hash database and add it
|
||||
@ -127,7 +128,7 @@ final class HashDbCreateDatabaseDialog extends javax.swing.JDialog {
|
||||
|
||||
private void enableComponents() {
|
||||
|
||||
if(! CentralRepository.isEnabled()){
|
||||
if (!CentralRepository.isEnabled() || !FeatureAccessUtils.canAddHashSetsToCentralRepo()) {
|
||||
centralRepoRadioButton.setEnabled(false);
|
||||
fileTypeRadioButton.setSelected(true);
|
||||
} else {
|
||||
@ -565,7 +566,9 @@ final class HashDbCreateDatabaseDialog extends javax.swing.JDialog {
|
||||
}//GEN-LAST:event_orgButtonActionPerformed
|
||||
|
||||
private void orgComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_orgComboBoxActionPerformed
|
||||
if (null == orgComboBox.getSelectedItem()) return;
|
||||
if (null == orgComboBox.getSelectedItem()) {
|
||||
return;
|
||||
}
|
||||
String orgName = this.orgComboBox.getSelectedItem().toString();
|
||||
for (CentralRepoOrganization org : orgs) {
|
||||
if (org.getName().equals(orgName)) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2011-2018 Basis Technology Corp.
|
||||
* Copyright 2013-2020 Basis Technology Corp.
|
||||
* Contact: carrier <at> sleuthkit <dot> org
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@ -42,6 +42,7 @@ import org.sleuthkit.autopsy.modules.hashdatabase.HashDbManager.HashDb.KnownFile
|
||||
import org.sleuthkit.autopsy.modules.hashdatabase.HashDbManager.HashDbManagerException;
|
||||
import org.sleuthkit.autopsy.modules.hashdatabase.HashDbManager.HashDb;
|
||||
import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepository;
|
||||
import org.sleuthkit.autopsy.featureaccess.FeatureAccessUtils;
|
||||
|
||||
/**
|
||||
* Instances of this class allow a user to select an existing hash database and
|
||||
@ -108,8 +109,7 @@ final class HashDbImportDatabaseDialog extends javax.swing.JDialog {
|
||||
|
||||
private void enableComponents() {
|
||||
|
||||
|
||||
if(! CentralRepository.isEnabled()){
|
||||
if (!CentralRepository.isEnabled() || !FeatureAccessUtils.canAddHashSetsToCentralRepo()) {
|
||||
centralRepoRadioButton.setEnabled(false);
|
||||
fileTypeRadioButton.setSelected(true);
|
||||
} else {
|
||||
@ -613,7 +613,9 @@ final class HashDbImportDatabaseDialog extends javax.swing.JDialog {
|
||||
}//GEN-LAST:event_orgButtonActionPerformed
|
||||
|
||||
private void orgComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_orgComboBoxActionPerformed
|
||||
if (null == orgComboBox.getSelectedItem()) return;
|
||||
if (null == orgComboBox.getSelectedItem()) {
|
||||
return;
|
||||
}
|
||||
String orgName = this.orgComboBox.getSelectedItem().toString();
|
||||
for (CentralRepoOrganization org : orgs) {
|
||||
if (org.getName().equals(orgName)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user