исправление безопасности. промежуточный.

This commit is contained in:
2025-02-06 18:31:18 +03:00
parent 6e0e51beff
commit 20e82075b7
11 changed files with 41 additions and 25 deletions

View File

@@ -24,6 +24,7 @@ public interface CallbackWindow extends VisualizerForm {
void ClearBugReportCommentAdditionText();
void FocusRecipients();
void SwitchScreen(boolean small);
void setUdefinedRights();
void setUserRights();
void setAdminRights();
}

View File

@@ -366,6 +366,15 @@ public class CallbackForm implements FormWithSplitters, CallbackWindow {
Global.mainModule.getUI().getMainWindow().SwitchTestingTabs(true);
}
@Override
public void setUdefinedRights(){
Global.mainModule.SetUserPassesAccess();
UI.Clear(accountPanel);
accountPanel.add(new CallbackWelcomeForm().content);
Global.mainModule.getUI().getMainWindow().SwitchTestingTabs(false);
Global.mainModule.getUI().getTestingMenuBar().showServerAdminLabel(false);
adminLabel.setVisible(false);
}
@Override
public void setUserRights() {
LockMyOnly();
Global.mainModule.SetUserPassesAccess();
@@ -391,17 +400,16 @@ public class CallbackForm implements FormWithSplitters, CallbackWindow {
lAccountName.setText(Utils_.Brackets(Global.mainModule.getAccount().name));
lAccountMail.setText(Utils_.Brackets(Global.mainModule.getAccount().email));
lAccountRole.setText(Utils_.Brackets(Global.mainModule.getAccount().role.getDescription()));
System.out.println("ROLE IS "+Global.mainModule.getAccount().role);
switch (Global.mainModule.getAccount().role) {
case Undefined:
/// UI.Clear(accountPanel);
// accountPanel.add(new CallbackWelcomeForm().content);
// UI.getMainWindow().SwitchTestingTabs(false);
// break;
setUdefinedRights();
break;
case User:
//видит только свои баги.
// EnableBugreports();
// setUserRights();
// break;
EnableBugreports();
setUserRights();
break;
case Developer:
EnableBugreports();
setDeveloperRights();

View File

@@ -218,7 +218,6 @@ public class MainForm extends Form implements MainWindow {
public void SwitchTestingTabs(boolean flag) {
globalTabs.setEnabledAt(3, flag);
globalTabs.setEnabledAt(4, flag);
// globalTabs.setEnabledAt(4, flag);
}
@Override
public TestingWindow getTestingWindow() {