package Visual_DVM_2021.Passes.All;
import _VisualDVM.Current;
import Common.Database.Database;
import _VisualDVM.Global;
import _VisualDVM.Repository.BugReport.BugReport;
import Common.Passes.DeleteObjectPass;
import Visual_DVM_2021.Passes.PassCode;
public class DeleteBugReport extends DeleteObjectPass<BugReport> {
    public DeleteBugReport() {
        super(BugReport.class);
    }
    @Override
    protected boolean canStart(Object... args) throws Exception {
        return super.canStart(args) && Global.mainModule.getAccount().CheckAccessRights(target.sender_address, Log);
    }
    @Override
    protected void performDone() throws Exception {
        super.performDone();
        Global.mainModule.getPass(PassCode.DeleteBugReportFromServer).Do(target);
    }
    @Override
    protected Database getDb() {
        return Global.componentsServer.db;
    }
}
