Browse Source

feat: add authorization check for instrument code retrieval endpoint

shangke 4 months ago
parent
commit
8103097bd3

+ 2 - 0
mec-application/src/main/java/com/ym/mec/web/controller/MusicSheetController.java

@@ -25,6 +25,7 @@ import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
@@ -169,6 +170,7 @@ public class MusicSheetController {
     @ApiImplicitParams({
         @ApiImplicitParam(name = "id", value = "id", dataType = "long")
     })
+    @PreAuthorize("@pcs.hasPermissions('musicSheet/instrumentCode')")
     @GetMapping("/instrumentCode")
     public R<List<MusicSheetWrapper.InstrumentCode>> instrumentCode() {