File tree Expand file tree Collapse file tree
main/java/com/DesktopApplicationClientJava/controllers
test/java/com/DesktopApplicationClientJava/ui Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -141,6 +141,10 @@ private void updateDeleteButtonState() {
141141
142142 @ FXML
143143 private void onOpenUsers (ActionEvent e ) {
144+ var authService = services == null ? null : services .getAuthService ();
145+ if (authService == null || !authService .isAdmin ()) {
146+ return ;
147+ }
144148 navigator .goTo ("/fxml/UserList.fxml" );
145149 }
146150
Original file line number Diff line number Diff line change @@ -87,6 +87,10 @@ private void setupSort() {
8787
8888 @ FXML
8989 private void onOpenResources (ActionEvent e ) {
90+ var authService = services == null ? null : services .getAuthService ();
91+ if (authService == null || !authService .isAdmin ()) {
92+ return ;
93+ }
9094 navigator .goTo ("/fxml/ResourceList.fxml" );
9195 }
9296
Original file line number Diff line number Diff line change 4444import javafx .scene .control .TextField ;
4545import javafx .stage .Stage ;
4646import org .junit .jupiter .api .BeforeEach ;
47- import org .junit .jupiter .api .Disabled ;
4847import org .junit .jupiter .api .DisplayName ;
4948import org .junit .jupiter .api .Tag ;
5049import org .junit .jupiter .api .Test ;
@@ -274,8 +273,6 @@ void circularNavigationGoesBothWays() {
274273 @ Test
275274 @ Tag ("role:moder" )
276275 @ DisplayName ("Модер не может перейти на список пользователей" )
277- @ Disabled (
278- "Gated: onOpenUsers ведёт на UserList безусловно, без проверки роли (скрытие кнопки ≠ запрет перехода)" )
279276 void nonAdminCannotNavigateToUserList () {
280277 robot .interact (
281278 () -> {
@@ -290,8 +287,6 @@ void nonAdminCannotNavigateToUserList() {
290287 @ Test
291288 @ Tag ("role:moder" )
292289 @ DisplayName ("Модер не может перейти на список ресурсов" )
293- @ Disabled (
294- "Gated: onOpenResources ведёт на ResourceList безусловно, без проверки роли (скрытие кнопки ≠ запрет перехода)" )
295290 void nonAdminCannotNavigateToResourceList () {
296291 robot .interact (
297292 () -> {
You can’t perform that action at this time.
0 commit comments