私は、Springのドキュメントと私の実験の結果として見られるものとの間に矛盾がありました。私はいくつかの方法を持っていると私は、次の準備メソッド呼び出しの前に、春のドキュメントに基づいて権限を確認する必要があります。Spring EL認証の "原理"がありません
@PreAuthorize("authentication.principle.company == #company.company")
public CompanyForm getCompanyForm(Company company) {
//some code here
}
しかし、驚くほどのメソッド呼び出しが原因このエラーに拒否された:
org.springframework.expression.spel.SpelEvaluationException: EL1008E:(pos 15): Property or field 'principle' cannot be found on object of type 'org.springframework.security.authentication.UsernamePasswordAuthenticationToken' - maybe not public?
誰かが私の間違いを指摘できますか?
大変ありがとうございます。 –