Рефакторинг кода панели быстрого доступа.
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
package _VisualDVM;
|
||||
import Common.Passes.Pass;
|
||||
import Common.Passes.PassCode_;
|
||||
import Common.Utils.Vector_;
|
||||
import MainModule_.MainModule_;
|
||||
import Visual_DVM_2021.Passes.PassCode;
|
||||
@@ -42,28 +40,13 @@ import javax.swing.tree.DefaultMutableTreeNode;
|
||||
import java.io.File;
|
||||
import java.util.Vector;
|
||||
public class MainModule extends MainModule_<GlobalDatabase> {
|
||||
Vector<PassCode> accountRoleDependentPasses = new Vector_<>(
|
||||
PassCode.AddSubscriber,
|
||||
PassCode.EditSubscriber,
|
||||
PassCode.DeleteSubscriber,
|
||||
PassCode.DeleteSubscriberWorkspace,
|
||||
//--
|
||||
PassCode.DownloadAllBugReportsArchives,
|
||||
//--
|
||||
PassCode.CompileServerSapfor,
|
||||
PassCode.DeleteServerSapfor,
|
||||
//
|
||||
PassCode.ShutdownComponentsServer,
|
||||
PassCode.StartComponentsServer,
|
||||
PassCode.PublishComponentsServer,
|
||||
//
|
||||
PassCode.ShutdownTestingServer,
|
||||
PassCode.StartTestingServer,
|
||||
PassCode.PublishTestingServer
|
||||
);
|
||||
public MainModule() {
|
||||
super(GlobalDatabase.class);
|
||||
}
|
||||
@Override
|
||||
public Class getPassCodesEnum() {
|
||||
return PassCode.class;
|
||||
}
|
||||
//--
|
||||
public boolean HasProject() {
|
||||
return get(Current.Project) != null;
|
||||
@@ -315,19 +298,35 @@ public class MainModule extends MainModule_<GlobalDatabase> {
|
||||
set(Current.Array, null);
|
||||
set(Current.DBArray, null);
|
||||
}
|
||||
@Override
|
||||
public Class getPassCodesEnum() {
|
||||
return PassCode.class;
|
||||
}
|
||||
public void SetUserAccess() {
|
||||
//--
|
||||
Vector<PassCode> accountRoleDependentPasses = new Vector_<>(
|
||||
PassCode.AddSubscriber,
|
||||
PassCode.EditSubscriber,
|
||||
PassCode.DeleteSubscriber,
|
||||
PassCode.DeleteSubscriberWorkspace,
|
||||
//--
|
||||
PassCode.DownloadAllBugReportsArchives,
|
||||
//--
|
||||
PassCode.CompileServerSapfor,
|
||||
PassCode.DeleteServerSapfor,
|
||||
//
|
||||
PassCode.ShutdownComponentsServer,
|
||||
PassCode.StartComponentsServer,
|
||||
PassCode.PublishComponentsServer,
|
||||
//
|
||||
PassCode.ShutdownTestingServer,
|
||||
PassCode.StartTestingServer,
|
||||
PassCode.PublishTestingServer
|
||||
);
|
||||
public void SetUserPassesAccess() {
|
||||
for (PassCode code: accountRoleDependentPasses)
|
||||
getPass(code).setControlsVisible(false);
|
||||
}
|
||||
public void SetDeveloperAccess() {
|
||||
SetUserAccess();
|
||||
public void SetDeveloperPassesAccess() {
|
||||
SetUserPassesAccess();
|
||||
getPass(PassCode.DownloadAllBugReportsArchives).setControlsVisible(true);
|
||||
}
|
||||
public void SetAdminAccess(){
|
||||
public void SetAdminPassesAccess(){
|
||||
for (PassCode code: accountRoleDependentPasses)
|
||||
getPass(code).setControlsVisible(true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user