インターフェース AuthorizationProxy

すべてのスーパーインターフェース:
org.springframework.aop.RawTargetAccess

public interface AuthorizationProxy extends org.springframework.aop.RawTargetAccess
Spring Security によってプロキシされているインスタンスを識別するために、Spring Security の AOP サポートによって通常実装されるインターフェース。

また、基盤となるターゲットオブジェクトにアクセスする方法も提供しており、認可ルールを呼び出さずにオブジェクトを操作するのに便利です。

これは、プロキシされたオブジェクトを操作し、Spring Data リポジトリのようにルールを呼び出さないアプリケーションのレイヤーに渡す必要がある場合に役立ちます。

MyObject object = this.objectRepository.findById(123L); // now an authorized proxy
 object.setProtectedValue(...); // only works if authorized
 if (object instanceof AuthorizationProxy proxy) {
        // Spring Data wants to be able to persist the entire object
        // so we'll remove the proxy
     object = (MyObject) proxy.toAuthorizedTarget();
 }
 this.objectRepository.save(object);
導入:
6.4
  • 方法の概要

    修飾子と型
    メソッド
    説明
    基礎となるターゲットオブジェクトにアクセスする
  • 方法の詳細

    • toAuthorizedTarget

      ObjectSE toAuthorizedTarget()
      基礎となるターゲットオブジェクトにアクセスする
      戻り値:
      ターゲットオブジェクト