GrantedAuthority
Declared
package org.springframework.security.core;
public interface GrantedAuthority extends Serializable
Class Jdoc
表示授权给用户的权限。
GrantedAuthority 必须是字符串,或者由AccessDecisionManager专门支持。
getAuthority
Decalred
String getAuthority();
Method Jdoc
如果GrantedAuthority可以表示为一个字符串,并且该字符串具有足够的精度,可以让AccessDecisionManager(或委托)用于访问控制决策,则此方法应该返回这样的字符串。
如果无法将GrantedAuthority精确地表示为字符串,则应返回null。返回null需要AccessDecisionManager(或委托)专门支持GrantedAuthority实现,所以应该避免返回null,除非实际需要。