有一个注释为@Preautorize
的Web服务方法@PreAuthorize("principal.somePrincipalMethod(#request.property1, #request.property2, 'stringA', 'stringB')")
public SomeResponse someWebServiceMethod(SomeRequest request) {
...
}
public class SomeRequest {
Long property1;
Long property2;
}
并且有两个重载方法的类实现UserDetails
public boolean somePrincipalMethod(Long longParam1, Long longParam2, String... stringParams) {
return true;
}
public boolean somePrincipalMethod(Long longParam, String... stringParams) {
return true;
}
当我致电someWebServiceMethod
时,我somePrincipalMethod(Long longParam, String... stringParams)
而不是somePrincipalMethod(Long longParam1, Long longParam2, String... stringParams)
我做错了什么?
答案 0 :(得分:0)
我找到了解决方案(解决方法)。
@PreAuthorize("principal.somePrincipalMethod(#request.property1, #request.property2, {'stringA', 'stringB'})")
public SomeResponse someWebServiceMethod(SomeRequest request) {
...
}
public boolean somePrincipalMethod(Long longParam1, Long longParam2, String[] stringParams) {
return true;
}
public boolean somePrincipalMethod(Long longParam, String[] stringParams) {
return true;
}