роль студента
This commit is contained in:
2025-03-26 14:00:46 +03:00
parent 919e7a2e10
commit 1ae4d1980a
9 changed files with 38 additions and 7 deletions

12
.idea/workspace.xml generated
View File

@@ -7,11 +7,15 @@
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment=""> <list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/DropSapforConfigurationEthalon.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/PassCode.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/PassCode.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/properties" beforeDir="false" afterPath="$PROJECT_DIR$/properties" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/SAPFOR/SapforConfiguration/UI/SapforConfigurationsForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/SAPFOR/SapforConfiguration/UI/SapforConfigurationsForm.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/UserAccount/AccountRole.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/UserAccount/AccountRole.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/SAPFOR/SapforPackage/UI/SapforPackagesForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/SAPFOR/SapforPackage/UI/SapforPackagesForm.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/UserAccount/UI/UserAccountFields.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/UserAccount/UI/UserAccountFields.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Constants.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Constants.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/MainModule.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/MainModule.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Visual/Interface/MainWindow.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Visual/Interface/MainWindow.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Visual/MainUI.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Visual/MainUI.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Visual/Windows/MainForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Visual/Windows/MainForm.java" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />

View File

@@ -34,7 +34,7 @@
"ErasePackageWorkspace": true, "ErasePackageWorkspace": true,
"lastMachineId": 28, "lastMachineId": 28,
"lastUserId": 36, "lastUserId": 36,
"lastCompilerId": 110, "lastCompilerId": 109,
"RegisterOn": false, "RegisterOn": false,
"SpacesOn": false, "SpacesOn": false,
"EmptyLinesOn": false, "EmptyLinesOn": false,

View File

@@ -3,6 +3,7 @@ import java.io.Serializable;
public enum AccountRole implements Serializable { public enum AccountRole implements Serializable {
Undefined, Undefined,
User, User,
Student,
Developer, Developer,
Admin; Admin;
public String getDescription() { public String getDescription() {
@@ -11,6 +12,8 @@ public enum AccountRole implements Serializable {
return "не зарегистрирован"; return "не зарегистрирован";
case User: case User:
return "Пользователь"; return "Пользователь";
case Student:
return "Студент";
case Developer: case Developer:
return "Разработчик"; return "Разработчик";
case Admin: case Admin:

View File

@@ -17,6 +17,7 @@ public class UserAccountFields implements DialogFields {
tfAddress = new StyledTextField(); tfAddress = new StyledTextField();
cbRole = new JComboBox<>(); cbRole = new JComboBox<>();
cbRole.addItem(AccountRole.User); cbRole.addItem(AccountRole.User);
cbRole.addItem(AccountRole.Student);
cbRole.addItem(AccountRole.Developer); cbRole.addItem(AccountRole.Developer);
cbRole.addItem(AccountRole.Admin); cbRole.addItem(AccountRole.Admin);
} }

View File

@@ -3,7 +3,7 @@ import Common.Utils.Vector_;
import java.util.Vector; import java.util.Vector;
public class Constants { public class Constants {
public static final int version = 1229; public static final int version = 1230;
public static final int planner_version = 24; public static final int planner_version = 24;
public static final int testingMaxKernels = 64; public static final int testingMaxKernels = 64;
//-- //--

View File

@@ -148,6 +148,9 @@ public class MainModule extends MainModule_<GlobalDatabase, MainUI> {
for (PassCode code : accountRoleDependentPasses) for (PassCode code : accountRoleDependentPasses)
getPass(code).setControlsVisible(false); getPass(code).setControlsVisible(false);
} }
public void SetStudentPassesAccess(){
SetUserPassesAccess();
}
public void SetDeveloperPassesAccess() { public void SetDeveloperPassesAccess() {
SetUserPassesAccess(); SetUserPassesAccess();
getPass(PassCode.CreateTestsGroupFromSelectedVersions).setControlsVisible(true); getPass(PassCode.CreateTestsGroupFromSelectedVersions).setControlsVisible(true);

View File

@@ -20,6 +20,7 @@ public interface MainWindow {
void ShowCheckedTestsCount(); void ShowCheckedTestsCount();
void ShowUndefinedTabs(); void ShowUndefinedTabs();
void ShowUserTabs(); void ShowUserTabs();
void ShowStudentTabs();
void ShowDeveloperTabs(); void ShowDeveloperTabs();
void ShowAdminTabs(); void ShowAdminTabs();
} }

View File

@@ -129,6 +129,20 @@ public class MainUI extends UIModule_ {
Global.normalProperties.AutoCheckTesting = false; Global.normalProperties.AutoCheckTesting = false;
Global.normalProperties.Update(); Global.normalProperties.Update();
} }
void showStudentRights(){
Global.mainModule.SetUserPassesAccess();
getMainWindow().ShowStudentTabs();
getTestingMenuBar().showServerAdminLabel(false);
getMainWindow().getCallbackWindow().showAllBugreports();
Global.normalProperties.setControlVisible("AutoBugReportsLoad", true);
Global.normalProperties.setControlVisible("AutoTestsLoad", false);
Global.normalProperties.setControlVisible("CreateEthalonTasks", false);
Global.normalProperties.setControlVisible("CompleteCompilationOptions", false);
Global.normalProperties.setControlVisible("CompleteRunEnvironments", false);
Global.normalProperties.setControlVisible("ErasePackageWorkspace", false);
Global.normalProperties.AutoCheckTesting = false;
Global.normalProperties.Update();
}
; ;
void showDeveloperRights() { void showDeveloperRights() {
Global.mainModule.SetDeveloperPassesAccess(); Global.mainModule.SetDeveloperPassesAccess();
@@ -164,6 +178,9 @@ public class MainUI extends UIModule_ {
case User: case User:
showUserRights(); showUserRights();
break; break;
case Student:
showStudentRights();
break;
case Developer: case Developer:
showDeveloperRights(); showDeveloperRights();
break; break;

View File

@@ -268,7 +268,9 @@ public class MainForm extends Form implements MainWindow {
} }
@Override @Override
public void ShowUserTabs() { public void ShowUserTabs() {
//тоже ничего не делаем. }
@Override
public void ShowStudentTabs() {
} }
@Override @Override
public void ShowDeveloperTabs() { public void ShowDeveloperTabs() {