Commit dfccfab2 by zzrdark

1.修改权限的字段

parent ff367eff
......@@ -51,7 +51,7 @@ public class MyUserDetailsService implements UserDetailsService {
List<String> funcPerms = userDto.getFuncPerms();
funcPerms.forEach( str -> {
authorities.add(new SimpleGrantedAuthority(str));
authorities.add(new SimpleGrantedAuthority("ROLE_"+str));
});
}
......
......@@ -13,6 +13,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -43,7 +44,7 @@ public class LogController {
@Autowired
private DeviceClient deviceClient;
@PreAuthorize("hasRole('remotelog:logfile:list') or hasRole('admin')")
@PostMapping("/logfile/list")
public R logFileList(@RequestParam(required = false) Integer page,
@RequestParam(required = false) Integer pageSize,
......@@ -105,6 +106,7 @@ public class LogController {
return new R().put("data",pageDto);
}
@PreAuthorize("hasRole('remotelog:logfile:delete') or hasRole('admin')")
@PostMapping("/logfile/delete")
public R deleteLogFile(@RequestParam(value = "ids",required = false) List<Long> ids){
logFileClient.deleteLogFile(ids);
......@@ -115,6 +117,7 @@ public class LogController {
* 处理完成日志
* @return
*/
@PreAuthorize("hasRole('remotelog:logfile:edit') or hasRole('admin')")
@PostMapping("/logfile/finish")
public R finishLog(@RequestParam(value = "logId") Long logId){
logFileClient.finishLog(logId);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment