权限配置自动注册

pull/9/MERGE
RuoYi 4 years ago
parent c404c280f7
commit d0fe6f3462

@ -0,0 +1,27 @@
package com.ruoyi.common.security.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
/**
*
* @EnableGlobalMethodSecurity(securedEnabled=true)
* @Secured
*
* @EnableGlobalMethodSecurity(jsr250Enabled=true)
* @RolesAllowed
*
* @EnableGlobalMethodSecurity(prePostEnabled=true)
* 使 4
* -@PreAuthorize ,访
* -@PostAuthorize ,false,
* -@PostFilter ,
* -@PreFilter ,
*
*/
@Configuration
@EnableGlobalMethodSecurity(prePostEnabled = true)
public class MethodSecurityConfig
{
}

@ -1,5 +1,7 @@
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.ruoyi.common.security.service.UserDetailsServiceImpl,\ com.ruoyi.common.security.service.UserDetailsServiceImpl,\
com.ruoyi.common.security.service.PermissionService,\
com.ruoyi.common.security.config.MethodSecurityConfig,\
com.ruoyi.common.security.handler.CustomAccessDeniedHandler,\ com.ruoyi.common.security.handler.CustomAccessDeniedHandler,\
com.ruoyi.common.security.handler.GlobalExceptionHandler com.ruoyi.common.security.handler.GlobalExceptionHandler

@ -62,7 +62,6 @@ public class SysConfigController extends BaseController
/** /**
* *
*/ */
@PreAuthorize("@ss.hasRole('admin')")
@GetMapping(value = "/{configId}") @GetMapping(value = "/{configId}")
public AjaxResult getInfo(@PathVariable Long configId) public AjaxResult getInfo(@PathVariable Long configId)
{ {

Loading…
Cancel
Save