Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ private void updateDeleteButtonState() {

@FXML
private void onOpenUsers(ActionEvent e) {
var authService = services == null ? null : services.getAuthService();
if (authService == null || !authService.isAdmin()) {
return;
}
navigator.goTo("/fxml/UserList.fxml");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ private void setupSort() {

@FXML
private void onOpenResources(ActionEvent e) {
var authService = services == null ? null : services.getAuthService();
if (authService == null || !authService.isAdmin()) {
return;
}
navigator.goTo("/fxml/ResourceList.fxml");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
import javafx.scene.control.TextField;
import javafx.stage.Stage;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -274,8 +273,6 @@ void circularNavigationGoesBothWays() {
@Test
@Tag("role:moder")
@DisplayName("Модер не может перейти на список пользователей")
@Disabled(
"Gated: onOpenUsers ведёт на UserList безусловно, без проверки роли (скрытие кнопки ≠ запрет перехода)")
void nonAdminCannotNavigateToUserList() {
robot.interact(
() -> {
Expand All @@ -290,8 +287,6 @@ void nonAdminCannotNavigateToUserList() {
@Test
@Tag("role:moder")
@DisplayName("Модер не может перейти на список ресурсов")
@Disabled(
"Gated: onOpenResources ведёт на ResourceList безусловно, без проверки роли (скрытие кнопки ≠ запрет перехода)")
void nonAdminCannotNavigateToResourceList() {
robot.interact(
() -> {
Expand Down
Loading