我最近开始了一个springboot课程,其中课程主管使用Spring Security GrantedAuthority界面。我无法解决GrantedAuthority的路径。在阅读更多内容之后,我看到它已被删除,现在应该使用SimpleGrantedAuthority。出于某种原因,我也无法解析SimpleGrantedAuthority的路径。在security.core.authority下我只有Mapping。知道我可以使用什么吗?
The code of the course I started:
package com.bookstore.domain.security;
import java.io.Serializable;
import org.springframework.security.core.GrantedAuthority;
public class Authority implements GrantedAuthority, Serializable {
private static final long serialVersionUID = 123123L;
private final String authority;
public Authority(String authority) {
this.authority = authority;
}
@Override
public String getAuthority() {
return authority;
}
}