[Developer] #424 add user and permission management

Refs #424
This commit is contained in:
devmrko
2026-06-23 11:28:59 +09:00
parent c55e7add27
commit 16718f0277
23 changed files with 708 additions and 3 deletions

View File

@@ -0,0 +1,48 @@
package com.cloudhandson.vpdbackoffice.web;
import com.cloudhandson.vpdbackoffice.domain.protectedobject.ProtectedObjectCreateCommand;
import com.cloudhandson.vpdbackoffice.service.ProtectedObjectService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
@Controller
public class ProtectedObjectController {
private final ProtectedObjectService protectedObjectService;
public ProtectedObjectController(ProtectedObjectService protectedObjectService) {
this.protectedObjectService = protectedObjectService;
}
@GetMapping("/objects")
public String objects(Model model) {
model.addAttribute("objects", protectedObjectService.findEnabled());
return "objects";
}
@PostMapping("/objects")
public String create(
@RequestParam String owner,
@RequestParam String objectName,
@RequestParam String ordsPath,
@RequestParam(required = false) String columns,
@RequestParam(required = false) String sensitiveColumns,
RedirectAttributes redirectAttributes
) {
protectedObjectService.createObject(
new ProtectedObjectCreateCommand(owner, objectName, ordsPath, columns, sensitiveColumns));
redirectAttributes.addFlashAttribute("message", "보호 객체를 추가했습니다.");
return "redirect:/objects";
}
@PostMapping("/objects/disable")
public String disable(@RequestParam long objectId, RedirectAttributes redirectAttributes) {
protectedObjectService.disableObject(objectId);
redirectAttributes.addFlashAttribute("message", "보호 객체를 비활성화했습니다.");
return "redirect:/objects";
}
}