Przeglądaj źródła

調整庫存權限

production
tommy 13 godzin temu
rodzic
commit
46f7d39f7b
2 zmienionych plików z 11 dodań i 0 usunięć
  1. +2
    -0
      src/main/java/com/ffii/fpsms/config/security/SecurityConfig.java
  2. +9
    -0
      src/main/resources/db/changelog/changes/20260617_inventory_adjust/01_inventory_adjust_authority.sql

+ 2
- 0
src/main/java/com/ffii/fpsms/config/security/SecurityConfig.java Wyświetl plik

@@ -109,6 +109,8 @@ public class SecurityConfig {
.hasAnyAuthority("TESTING", "ADMIN")
.requestMatchers(HttpMethod.GET, "/label-printer-monitor/label-stats")
.hasAnyAuthority("TESTING", "ADMIN")
.requestMatchers(HttpMethod.POST, "/stockAdjustment/submit")
.hasAnyAuthority("ADMIN", "INVENTORY_ADJUST")
.anyRequest().authenticated())
.httpBasic(httpBasic -> httpBasic.authenticationEntryPoint(
(request, response, authException) -> sendUnauthorizedJson(response, "Unauthorized", "UNAUTHORIZED")))


+ 9
- 0
src/main/resources/db/changelog/changes/20260617_inventory_adjust/01_inventory_adjust_authority.sql Wyświetl plik

@@ -0,0 +1,9 @@
--liquibase formatted sql

--changeset fpsms:inventory_adjust_authority
--preconditions onFail:MARK_RAN
--precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM authority WHERE authority = 'INVENTORY_ADJUST'
--comment: Add independent permission for stock adjustment (inventory adjustment)
INSERT IGNORE INTO `authority` (`authority`, `name`, `module`, `description`)
VALUES ('INVENTORY_ADJUST', '庫存調整', 'INVENTORY', 'Allow submitting stock adjustments (POST /stockAdjustment/submit)');


Ładowanie…
Anuluj
Zapisz