Обновление прав.Разработчики могут произвольно работать с багами

v++
This commit is contained in:
2025-02-01 22:24:15 +03:00
parent ef5089443a
commit 6911bc6cdb
154 changed files with 229 additions and 61934 deletions

View File

@@ -5,6 +5,7 @@ import Common.Utils.TextLog;
import Common.Utils.Utils_;
import Common.Utils.Vector_;
import _VisualDVM.Global;
import _VisualDVM.GlobalData.Account.Account;
import _VisualDVM.ProjectData.SapforData.SapforProperties;
import _VisualDVM.Repository.BugReport.Json.RecipientJson;
import _VisualDVM.Repository.BugReport.Json.RecipientsJson;
@@ -51,7 +52,7 @@ public class BugReport extends rDBObject {
project_version = version_in;
visualiser_version = Global.visualiser.version;
sapfor_version = Global.components.get(ComponentType.Sapfor_F).version;
packedSettingsJson = Utils_.gson.toJson(Global.mainModule.getProject().sapforProperties);
packedSettingsJson = Utils_.gson.toJson(Global.mainModule.getProject().sapforProperties);
percentage = 0;
description = description_in;
date = new Date().getTime();
@@ -129,14 +130,14 @@ public class BugReport extends rDBObject {
"Версия визуализатора: " + visualiser_version,
"----------------------------------"
);
if (!project_version.isEmpty()) {
if (visualiser_version < 1134) {
res.add(getSettingsJson().getSummary());
} else {
res.add(getPropertiesJson().getSummary());
}
}
return String.join("\n", res);
if (!project_version.isEmpty()) {
if (visualiser_version < 1134) {
res.add(getSettingsJson().getSummary());
} else {
res.add(getPropertiesJson().getSummary());
}
}
return String.join("\n", res);
}
public String getPassport() {
return String.join("\n",
@@ -163,15 +164,47 @@ public class BugReport extends rDBObject {
Vector<String> res = new Vector<>();
if (packedRecipientsJson.isEmpty()) return res;
RecipientsJson recipients = Utils_.gson.fromJson(packedRecipientsJson, RecipientsJson.class);
for (RecipientJson recipientJson: recipients.array){
for (RecipientJson recipientJson : recipients.array) {
res.add(recipientJson.address);
}
return res;
}
public VisualiserSettingsJson getSettingsJson(){
return packedSettingsJson.isEmpty()? new VisualiserSettingsJson(): Utils_.gson.fromJson(packedSettingsJson,VisualiserSettingsJson.class);
public VisualiserSettingsJson getSettingsJson() {
return packedSettingsJson.isEmpty() ? new VisualiserSettingsJson() : Utils_.gson.fromJson(packedSettingsJson, VisualiserSettingsJson.class);
}
public SapforProperties getPropertiesJson(){
return packedSettingsJson.isEmpty()? new SapforProperties(): Utils_.gson.fromJson(packedSettingsJson,SapforProperties.class);
public SapforProperties getPropertiesJson() {
return packedSettingsJson.isEmpty() ? new SapforProperties() : Utils_.gson.fromJson(packedSettingsJson, SapforProperties.class);
}
public boolean canAppend(Account account, TextLog log) {
if (account.CheckRegistered(log)) {
if (account.email.equals(sender_address) || account.email.equals(executor_address)) {
return true;
} else {
switch (account.role) {
case Admin:
case Developer:
return true;
default:
if (log != null)
log.Writeln_("Вы не являетесь автором, исполнителем, разработчиком, или администратором");
return false;
}
}
}
return false;
}
public boolean canModify(Account account, TextLog log) {
if (account.CheckRegistered(log)) {
switch (account.role) {
case Admin:
case Developer:
return true;
default:
if (account.email.equals(sender_address)) return true;
if (log != null) log.Writeln_("Вы не являетесь автором, разработчиком, или администратором");
return false;
}
}
return false;
}
}

View File

@@ -62,7 +62,7 @@ public class Visualiser extends Component {
//http://www.seostella.com/ru/article/2012/02/05/formatirovanie-daty-v-java.html
@Override
public void GetVersionInfo() {
version = 1141;
version = 1142;
String pattern = "MMM dd yyyy HH:mm:ss";
DateFormat df = new SimpleDateFormat(pattern, Locale.ENGLISH);
date_text = df.format(getClassBuildTime());