package com.l7tech.server.security.rbac;

import com.l7tech.gateway.common.security.rbac.EntityFolderAncestryPredicate;
import com.l7tech.gateway.common.security.rbac.OperationType;
import com.l7tech.gateway.common.security.rbac.Permission;
import com.l7tech.gateway.common.security.rbac.Role;
import com.l7tech.gateway.common.security.rbac.ScopeEvaluator;
import com.l7tech.gateway.common.security.rbac.ScopePredicate;
import com.l7tech.identity.User;
import com.l7tech.objectmodel.Entity;
import com.l7tech.objectmodel.EntityType;
import com.l7tech.objectmodel.FindException;
import com.l7tech.objectmodel.Goid;
import com.l7tech.objectmodel.OrganizationHeader;
import com.l7tech.server.EntityFinder;
import com.l7tech.server.event.EntityInvalidationEvent;
import com.l7tech.server.identity.HasDefaultRole;
import com.l7tech.server.identity.IdentityProviderFactory;
import com.l7tech.server.util.PostStartupApplicationListener;
import com.l7tech.util.Pair;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.ApplicationEvent;

public class RbacServicesImpl implements RbacServices, InitializingBean, PostStartupApplicationListener, ApplicationContextAware {
   private static final Logger a;
   private final Map<Class<? extends ScopePredicate>, ScopeEvaluatorFactory> b = new HashMap<Class<? extends ScopePredicate>, ScopeEvaluatorFactory>() {
      static final long serialVersionUID = -3362687384747444434L;

      {
         this.put(EntityFolderAncestryPredicate.class, new c(RbacServicesImpl.this));
      }
   };
   private final Map<ScopePredicate, ScopeEvaluator> c = new ConcurrentHashMap<>();
   private RoleManager d;
   private EntityFinder e;
   private ProtectedEntityTracker f;
   private ApplicationContext g;
   private static final String[] h;

   public RbacServicesImpl(RoleManager var1, EntityFinder var2, ProtectedEntityTracker var3) {
      this.d = var1;
      this.e = var2;
      this.f = var3;
   }

   public RbacServicesImpl() {
   }

   @Override
   public boolean isPermittedForEntitiesOfTypes(User param1, OperationType param2, Set<EntityType> param3) throws FindException {
      // $VF: Couldn't be decompiled
      // Please report this to the Vineflower issue tracker, at https://github.com/Vineflower/vineflower/issues with a copy of the class file (if you have the rights to distribute it!)
      // java.lang.RuntimeException: parsing failure!
      //   at org.jetbrains.java.decompiler.modules.decompiler.decompose.DomHelper.parseGraph(DomHelper.java:211)
      //   at org.jetbrains.java.decompiler.main.rels.MethodProcessor.codeToJava(MethodProcessor.java:174)
      //
      // Bytecode:
      // 000: aload 1
      // 001: ifnonnull 010
      // 004: new java/lang/IllegalArgumentException
      // 007: dup
      // 008: invokespecial java/lang/IllegalArgumentException.<init> ()V
      // 00b: athrow
      // 00c: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 00f: athrow
      // 010: aload 3
      // 011: ifnull 024
      // 014: aload 3
      // 015: invokeinterface java/util/Set.isEmpty ()Z 1
      // 01a: ifeq 030
      // 01d: goto 024
      // 020: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 023: athrow
      // 024: new java/lang/IllegalArgumentException
      // 027: dup
      // 028: invokespecial java/lang/IllegalArgumentException.<init> ()V
      // 02b: athrow
      // 02c: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 02f: athrow
      // 030: aload 2
      // 031: ifnull 045
      // 034: getstatic com/l7tech/gateway/common/security/rbac/OperationType.ALL_CRUD Ljava/util/EnumSet;
      // 037: aload 2
      // 038: invokevirtual java/util/EnumSet.contains (Ljava/lang/Object;)Z
      // 03b: ifne 051
      // 03e: goto 045
      // 041: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 044: athrow
      // 045: new java/lang/IllegalArgumentException
      // 048: dup
      // 049: invokespecial java/lang/IllegalArgumentException.<init> ()V
      // 04c: athrow
      // 04d: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 050: athrow
      // 051: new java/util/HashMap
      // 054: dup
      // 055: invokespecial java/util/HashMap.<init> ()V
      // 058: astore 4
      // 05a: aload 0
      // 05b: aload 1
      // 05c: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Lcom/l7tech/identity/User;)Lcom/l7tech/util/Pair;
      // 05f: aload 1
      // 060: invokevirtual com/l7tech/server/security/rbac/RbacServicesImpl.getAssignedRoles (Lcom/l7tech/util/Pair;Lcom/l7tech/identity/User;)Ljava/util/Collection;
      // 063: invokeinterface java/util/Collection.iterator ()Ljava/util/Iterator; 1
      // 068: astore 5
      // 06a: aload 5
      // 06c: invokeinterface java/util/Iterator.hasNext ()Z 1
      // 071: ifeq 0fe
      // 074: aload 5
      // 076: invokeinterface java/util/Iterator.next ()Ljava/lang/Object; 1
      // 07b: checkcast com/l7tech/gateway/common/security/rbac/Role
      // 07e: astore 6
      // 080: aload 6
      // 082: invokevirtual com/l7tech/gateway/common/security/rbac/Role.getPermissions ()Ljava/util/Set;
      // 085: invokeinterface java/util/Set.iterator ()Ljava/util/Iterator; 1
      // 08a: astore 7
      // 08c: aload 7
      // 08e: invokeinterface java/util/Iterator.hasNext ()Z 1
      // 093: ifeq 0fb
      // 096: aload 7
      // 098: invokeinterface java/util/Iterator.next ()Ljava/lang/Object; 1
      // 09d: checkcast com/l7tech/gateway/common/security/rbac/Permission
      // 0a0: astore 8
      // 0a2: aload 8
      // 0a4: invokevirtual com/l7tech/gateway/common/security/rbac/Permission.getScope ()Ljava/util/Set;
      // 0a7: ifnull 0c5
      // 0aa: aload 8
      // 0ac: invokevirtual com/l7tech/gateway/common/security/rbac/Permission.getScope ()Ljava/util/Set;
      // 0af: invokeinterface java/util/Set.isEmpty ()Z 1
      // 0b4: ifne 0c5
      // 0b7: goto 0be
      // 0ba: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 0bd: athrow
      // 0be: goto 08c
      // 0c1: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 0c4: athrow
      // 0c5: aload 8
      // 0c7: invokevirtual com/l7tech/gateway/common/security/rbac/Permission.getOperation ()Lcom/l7tech/gateway/common/security/rbac/OperationType;
      // 0ca: aload 2
      // 0cb: if_acmpeq 0d5
      // 0ce: goto 08c
      // 0d1: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 0d4: athrow
      // 0d5: aload 8
      // 0d7: invokevirtual com/l7tech/gateway/common/security/rbac/Permission.getEntityType ()Lcom/l7tech/objectmodel/EntityType;
      // 0da: astore 9
      // 0dc: aload 9
      // 0de: getstatic com/l7tech/objectmodel/EntityType.ANY Lcom/l7tech/objectmodel/EntityType;
      // 0e1: if_acmpne 0ea
      // 0e4: bipush 1
      // 0e5: ireturn
      // 0e6: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 0e9: athrow
      // 0ea: aload 4
      // 0ec: aload 9
      // 0ee: bipush 1
      // 0ef: invokestatic java/lang/Boolean.valueOf (Z)Ljava/lang/Boolean;
      // 0f2: invokeinterface java/util/Map.put (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; 3
      // 0f7: pop
      // 0f8: goto 08c
      // 0fb: goto 06a
      // 0fe: aload 4
      // 100: invokeinterface java/util/Map.isEmpty ()Z 1
      // 105: ifeq 10e
      // 108: bipush 0
      // 109: ireturn
      // 10a: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 10d: athrow
      // 10e: aload 3
      // 10f: invokeinterface java/util/Set.iterator ()Ljava/util/Iterator; 1
      // 114: astore 5
      // 116: aload 5
      // 118: invokeinterface java/util/Iterator.hasNext ()Z 1
      // 11d: ifeq 148
      // 120: aload 5
      // 122: invokeinterface java/util/Iterator.next ()Ljava/lang/Object; 1
      // 127: checkcast com/l7tech/objectmodel/EntityType
      // 12a: astore 6
      // 12c: aload 4
      // 12e: aload 6
      // 130: invokeinterface java/util/Map.get (Ljava/lang/Object;)Ljava/lang/Object; 2
      // 135: checkcast java/lang/Boolean
      // 138: astore 7
      // 13a: aload 7
      // 13c: ifnonnull 145
      // 13f: bipush 0
      // 140: ireturn
      // 141: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 144: athrow
      // 145: goto 116
      // 148: bipush 1
      // 149: ireturn
      // try (0 -> 6): 6 com/l7tech/objectmodel/FindException
      // try (8 -> 13): 14 com/l7tech/objectmodel/FindException
      // try (10 -> 20): 20 com/l7tech/objectmodel/FindException
      // try (22 -> 28): 29 com/l7tech/objectmodel/FindException
      // try (24 -> 35): 35 com/l7tech/objectmodel/FindException
      // try (66 -> 73): 74 com/l7tech/objectmodel/FindException
      // try (69 -> 77): 77 com/l7tech/objectmodel/FindException
      // try (79 -> 84): 84 com/l7tech/objectmodel/FindException
      // try (89 -> 94): 94 com/l7tech/objectmodel/FindException
      // try (104 -> 109): 109 com/l7tech/objectmodel/FindException
      // try (126 -> 130): 130 com/l7tech/objectmodel/FindException
   }

   @Override
   public boolean isPermittedForAnyEntityOfType(User param1, OperationType param2, EntityType param3) throws FindException {
      // $VF: Couldn't be decompiled
      // Please report this to the Vineflower issue tracker, at https://github.com/Vineflower/vineflower/issues with a copy of the class file (if you have the rights to distribute it!)
      // java.lang.RuntimeException: parsing failure!
      //   at org.jetbrains.java.decompiler.modules.decompiler.decompose.DomHelper.parseGraph(DomHelper.java:211)
      //   at org.jetbrains.java.decompiler.main.rels.MethodProcessor.codeToJava(MethodProcessor.java:174)
      //
      // Bytecode:
      // 00: aload 1
      // 01: ifnull 0f
      // 04: aload 3
      // 05: ifnonnull 1b
      // 08: goto 0f
      // 0b: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 0e: athrow
      // 0f: new java/lang/NullPointerException
      // 12: dup
      // 13: invokespecial java/lang/NullPointerException.<init> ()V
      // 16: athrow
      // 17: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 1a: athrow
      // 1b: getstatic com/l7tech/server/security/rbac/RbacServicesImpl.a Ljava/util/logging/Logger;
      // 1e: getstatic java/util/logging/Level.FINE Ljava/util/logging/Level;
      // 21: getstatic com/l7tech/server/security/rbac/RbacServicesImpl.h [Ljava/lang/String;
      // 24: bipush 7
      // 26: aaload
      // 27: bipush 2
      // 28: anewarray 74
      // 2b: dup
      // 2c: bipush 0
      // 2d: aload 2
      // 2e: invokevirtual com/l7tech/gateway/common/security/rbac/OperationType.getName ()Ljava/lang/String;
      // 31: aastore
      // 32: dup
      // 33: bipush 1
      // 34: aload 3
      // 35: invokevirtual com/l7tech/objectmodel/EntityType.getName ()Ljava/lang/String;
      // 38: aastore
      // 39: invokevirtual java/util/logging/Logger.log (Ljava/util/logging/Level;Ljava/lang/String;[Ljava/lang/Object;)V
      // 3c: aload 0
      // 3d: aload 1
      // 3e: aload 2
      // 3f: aload 3
      // 40: bipush 1
      // 41: invokevirtual com/l7tech/server/security/rbac/RbacServicesImpl.a (Lcom/l7tech/identity/User;Lcom/l7tech/gateway/common/security/rbac/OperationType;Lcom/l7tech/objectmodel/EntityType;Z)Z
      // 44: ireturn
      // try (0 -> 4): 5 com/l7tech/objectmodel/FindException
      // try (2 -> 11): 11 com/l7tech/objectmodel/FindException
   }

   @Override
   public boolean isPermittedForSomeEntityOfType(User param1, OperationType param2, EntityType param3) throws FindException {
      // $VF: Couldn't be decompiled
      // Please report this to the Vineflower issue tracker, at https://github.com/Vineflower/vineflower/issues with a copy of the class file (if you have the rights to distribute it!)
      // java.lang.RuntimeException: parsing failure!
      //   at org.jetbrains.java.decompiler.modules.decompiler.decompose.DomHelper.parseGraph(DomHelper.java:211)
      //   at org.jetbrains.java.decompiler.main.rels.MethodProcessor.codeToJava(MethodProcessor.java:174)
      //
      // Bytecode:
      // 00: aload 1
      // 01: ifnull 0f
      // 04: aload 3
      // 05: ifnonnull 1b
      // 08: goto 0f
      // 0b: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 0e: athrow
      // 0f: new java/lang/NullPointerException
      // 12: dup
      // 13: invokespecial java/lang/NullPointerException.<init> ()V
      // 16: athrow
      // 17: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 1a: athrow
      // 1b: getstatic com/l7tech/server/security/rbac/RbacServicesImpl.a Ljava/util/logging/Logger;
      // 1e: getstatic java/util/logging/Level.FINE Ljava/util/logging/Level;
      // 21: getstatic com/l7tech/server/security/rbac/RbacServicesImpl.h [Ljava/lang/String;
      // 24: bipush 22
      // 26: aaload
      // 27: bipush 2
      // 28: anewarray 74
      // 2b: dup
      // 2c: bipush 0
      // 2d: aload 2
      // 2e: invokevirtual com/l7tech/gateway/common/security/rbac/OperationType.getName ()Ljava/lang/String;
      // 31: aastore
      // 32: dup
      // 33: bipush 1
      // 34: aload 3
      // 35: invokevirtual com/l7tech/objectmodel/EntityType.getName ()Ljava/lang/String;
      // 38: aastore
      // 39: invokevirtual java/util/logging/Logger.log (Ljava/util/logging/Level;Ljava/lang/String;[Ljava/lang/Object;)V
      // 3c: aload 0
      // 3d: aload 1
      // 3e: aload 2
      // 3f: aload 3
      // 40: bipush 0
      // 41: invokevirtual com/l7tech/server/security/rbac/RbacServicesImpl.a (Lcom/l7tech/identity/User;Lcom/l7tech/gateway/common/security/rbac/OperationType;Lcom/l7tech/objectmodel/EntityType;Z)Z
      // 44: ireturn
      // try (0 -> 4): 5 com/l7tech/objectmodel/FindException
      // try (2 -> 11): 11 com/l7tech/objectmodel/FindException
   }

   private boolean a(User param1, OperationType param2, EntityType param3, boolean param4) throws FindException {
      // $VF: Couldn't be decompiled
      // Please report this to the Vineflower issue tracker, at https://github.com/Vineflower/vineflower/issues with a copy of the class file (if you have the rights to distribute it!)
      // java.lang.RuntimeException: parsing failure!
      //   at org.jetbrains.java.decompiler.modules.decompiler.decompose.DomHelper.parseGraph(DomHelper.java:211)
      //   at org.jetbrains.java.decompiler.main.rels.MethodProcessor.codeToJava(MethodProcessor.java:174)
      //
      // Bytecode:
      // 00: aload 0
      // 01: aload 1
      // 02: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Lcom/l7tech/identity/User;)Lcom/l7tech/util/Pair;
      // 05: aload 1
      // 06: invokevirtual com/l7tech/server/security/rbac/RbacServicesImpl.getAssignedRoles (Lcom/l7tech/util/Pair;Lcom/l7tech/identity/User;)Ljava/util/Collection;
      // 09: invokeinterface java/util/Collection.iterator ()Ljava/util/Iterator; 1
      // 0e: astore 5
      // 10: aload 5
      // 12: invokeinterface java/util/Iterator.hasNext ()Z 1
      // 17: ifeq af
      // 1a: aload 5
      // 1c: invokeinterface java/util/Iterator.next ()Ljava/lang/Object; 1
      // 21: checkcast com/l7tech/gateway/common/security/rbac/Role
      // 24: astore 6
      // 26: aload 6
      // 28: invokevirtual com/l7tech/gateway/common/security/rbac/Role.getPermissions ()Ljava/util/Set;
      // 2b: invokeinterface java/util/Set.iterator ()Ljava/util/Iterator; 1
      // 30: astore 7
      // 32: aload 7
      // 34: invokeinterface java/util/Iterator.hasNext ()Z 1
      // 39: ifeq ac
      // 3c: aload 7
      // 3e: invokeinterface java/util/Iterator.next ()Ljava/lang/Object; 1
      // 43: checkcast com/l7tech/gateway/common/security/rbac/Permission
      // 46: astore 8
      // 48: iload 4
      // 4a: ifeq 77
      // 4d: aload 8
      // 4f: invokevirtual com/l7tech/gateway/common/security/rbac/Permission.getScope ()Ljava/util/Set;
      // 52: ifnull 77
      // 55: goto 5c
      // 58: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 5b: athrow
      // 5c: aload 8
      // 5e: invokevirtual com/l7tech/gateway/common/security/rbac/Permission.getScope ()Ljava/util/Set;
      // 61: invokeinterface java/util/Set.isEmpty ()Z 1
      // 66: ifne 77
      // 69: goto 70
      // 6c: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 6f: athrow
      // 70: goto 32
      // 73: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 76: athrow
      // 77: aload 8
      // 79: invokevirtual com/l7tech/gateway/common/security/rbac/Permission.getOperation ()Lcom/l7tech/gateway/common/security/rbac/OperationType;
      // 7c: aload 2
      // 7d: if_acmpeq 87
      // 80: goto 32
      // 83: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 86: athrow
      // 87: aload 8
      // 89: invokevirtual com/l7tech/gateway/common/security/rbac/Permission.getEntityType ()Lcom/l7tech/objectmodel/EntityType;
      // 8c: astore 9
      // 8e: aload 9
      // 90: getstatic com/l7tech/objectmodel/EntityType.ANY Lcom/l7tech/objectmodel/EntityType;
      // 93: if_acmpeq a3
      // 96: aload 9
      // 98: aload 3
      // 99: if_acmpne a9
      // 9c: goto a3
      // 9f: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // a2: athrow
      // a3: bipush 1
      // a4: ireturn
      // a5: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // a8: athrow
      // a9: goto 32
      // ac: goto 10
      // af: bipush 0
      // b0: ireturn
      // try (25 -> 30): 31 com/l7tech/objectmodel/FindException
      // try (27 -> 37): 38 com/l7tech/objectmodel/FindException
      // try (33 -> 41): 41 com/l7tech/objectmodel/FindException
      // try (43 -> 48): 48 com/l7tech/objectmodel/FindException
      // try (53 -> 59): 60 com/l7tech/objectmodel/FindException
      // try (56 -> 64): 64 com/l7tech/objectmodel/FindException
   }

   @Override
   public boolean isPermittedForEntity(User param1, Entity param2, OperationType param3, String param4) throws FindException {
      // $VF: Couldn't be decompiled
      // Please report this to the Vineflower issue tracker, at https://github.com/Vineflower/vineflower/issues with a copy of the class file (if you have the rights to distribute it!)
      // java.lang.RuntimeException: parsing failure!
      //   at org.jetbrains.java.decompiler.modules.decompiler.decompose.DomHelper.parseGraph(DomHelper.java:211)
      //   at org.jetbrains.java.decompiler.main.rels.MethodProcessor.codeToJava(MethodProcessor.java:174)
      //
      // Bytecode:
      // 00: aload 1
      // 01: ifnull 1a
      // 04: aload 2
      // 05: ifnull 1a
      // 08: goto 0f
      // 0b: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 0e: athrow
      // 0f: aload 3
      // 10: ifnonnull 26
      // 13: goto 1a
      // 16: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 19: athrow
      // 1a: new java/lang/NullPointerException
      // 1d: dup
      // 1e: invokespecial java/lang/NullPointerException.<init> ()V
      // 21: athrow
      // 22: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 25: athrow
      // 26: aload 3
      // 27: getstatic com/l7tech/gateway/common/security/rbac/OperationType.OTHER Lcom/l7tech/gateway/common/security/rbac/OperationType;
      // 2a: if_acmpne 4b
      // 2d: aload 4
      // 2f: ifnonnull 4b
      // 32: goto 39
      // 35: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 38: athrow
      // 39: new java/lang/IllegalArgumentException
      // 3c: dup
      // 3d: getstatic com/l7tech/server/security/rbac/RbacServicesImpl.h [Ljava/lang/String;
      // 40: bipush 13
      // 42: aaload
      // 43: invokespecial java/lang/IllegalArgumentException.<init> (Ljava/lang/String;)V
      // 46: athrow
      // 47: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 4a: athrow
      // 4b: getstatic com/l7tech/server/security/rbac/RbacServicesImpl.a Ljava/util/logging/Logger;
      // 4e: getstatic java/util/logging/Level.FINE Ljava/util/logging/Level;
      // 51: getstatic com/l7tech/server/security/rbac/RbacServicesImpl.h [Ljava/lang/String;
      // 54: bipush 17
      // 56: aaload
      // 57: bipush 3
      // 58: anewarray 74
      // 5b: dup
      // 5c: bipush 0
      // 5d: aload 3
      // 5e: invokevirtual com/l7tech/gateway/common/security/rbac/OperationType.getName ()Ljava/lang/String;
      // 61: aastore
      // 62: dup
      // 63: bipush 1
      // 64: aload 2
      // 65: invokeinterface com/l7tech/objectmodel/Entity.getClass ()Ljava/lang/Class; 1
      // 6a: invokevirtual java/lang/Class.getSimpleName ()Ljava/lang/String;
      // 6d: aastore
      // 6e: dup
      // 6f: bipush 2
      // 70: aload 2
      // 71: invokeinterface com/l7tech/objectmodel/Entity.getId ()Ljava/lang/String; 1
      // 76: aastore
      // 77: invokestatic java/lang/String.format (Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
      // 7a: invokevirtual java/util/logging/Logger.log (Ljava/util/logging/Level;Ljava/lang/String;)V
      // 7d: aload 0
      // 7e: aload 0
      // 7f: aload 1
      // 80: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Lcom/l7tech/identity/User;)Lcom/l7tech/util/Pair;
      // 83: aload 1
      // 84: invokevirtual com/l7tech/server/security/rbac/RbacServicesImpl.getAssignedRoles (Lcom/l7tech/util/Pair;Lcom/l7tech/identity/User;)Ljava/util/Collection;
      // 87: aload 2
      // 88: aload 3
      // 89: aload 4
      // 8b: invokevirtual com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/util/Collection;Lcom/l7tech/objectmodel/Entity;Lcom/l7tech/gateway/common/security/rbac/OperationType;Ljava/lang/String;)Z
      // 8e: ireturn
      // try (0 -> 4): 5 com/l7tech/objectmodel/FindException
      // try (2 -> 9): 10 com/l7tech/objectmodel/FindException
      // try (7 -> 16): 16 com/l7tech/objectmodel/FindException
      // try (18 -> 23): 24 com/l7tech/objectmodel/FindException
      // try (21 -> 33): 33 com/l7tech/objectmodel/FindException
   }

   @Override
   public <T extends OrganizationHeader> Iterable<T> filterPermittedHeaders(User param1, OperationType param2, Iterable<T> param3, EntityFinder param4) throws FindException {
      // $VF: Couldn't be decompiled
      // Please report this to the Vineflower issue tracker, at https://github.com/Vineflower/vineflower/issues with a copy of the class file (if you have the rights to distribute it!)
      // java.lang.RuntimeException: parsing failure!
      //   at org.jetbrains.java.decompiler.modules.decompiler.decompose.DomHelper.parseGraph(DomHelper.java:211)
      //   at org.jetbrains.java.decompiler.main.rels.MethodProcessor.codeToJava(MethodProcessor.java:174)
      //
      // Bytecode:
      // 00: aload 1
      // 01: ifnonnull 10
      // 04: new java/lang/IllegalArgumentException
      // 07: dup
      // 08: invokespecial java/lang/IllegalArgumentException.<init> ()V
      // 0b: athrow
      // 0c: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 0f: athrow
      // 10: aload 2
      // 11: ifnull 25
      // 14: getstatic com/l7tech/gateway/common/security/rbac/OperationType.ALL_CRUD Ljava/util/EnumSet;
      // 17: aload 2
      // 18: invokevirtual java/util/EnumSet.contains (Ljava/lang/Object;)Z
      // 1b: ifne 31
      // 1e: goto 25
      // 21: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 24: athrow
      // 25: new java/lang/IllegalArgumentException
      // 28: dup
      // 29: invokespecial java/lang/IllegalArgumentException.<init> ()V
      // 2c: athrow
      // 2d: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 30: athrow
      // 31: aload 0
      // 32: aload 1
      // 33: aload 2
      // 34: getstatic com/l7tech/objectmodel/EntityType.SERVICE Lcom/l7tech/objectmodel/EntityType;
      // 37: invokevirtual com/l7tech/server/security/rbac/RbacServicesImpl.isPermittedForAnyEntityOfType (Lcom/l7tech/identity/User;Lcom/l7tech/gateway/common/security/rbac/OperationType;Lcom/l7tech/objectmodel/EntityType;)Z
      // 3a: ifeq 56
      // 3d: aload 0
      // 3e: aload 1
      // 3f: aload 2
      // 40: getstatic com/l7tech/objectmodel/EntityType.POLICY Lcom/l7tech/objectmodel/EntityType;
      // 43: invokevirtual com/l7tech/server/security/rbac/RbacServicesImpl.isPermittedForAnyEntityOfType (Lcom/l7tech/identity/User;Lcom/l7tech/gateway/common/security/rbac/OperationType;Lcom/l7tech/objectmodel/EntityType;)Z
      // 46: ifeq 56
      // 49: goto 50
      // 4c: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 4f: athrow
      // 50: aload 3
      // 51: areturn
      // 52: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 55: athrow
      // 56: aload 0
      // 57: aload 1
      // 58: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Lcom/l7tech/identity/User;)Lcom/l7tech/util/Pair;
      // 5b: aload 1
      // 5c: invokevirtual com/l7tech/server/security/rbac/RbacServicesImpl.getAssignedRoles (Lcom/l7tech/util/Pair;Lcom/l7tech/identity/User;)Ljava/util/Collection;
      // 5f: astore 5
      // 61: aload 5
      // 63: invokeinterface java/util/Collection.isEmpty ()Z 1
      // 68: ifeq 73
      // 6b: invokestatic java/util/Collections.emptyList ()Ljava/util/List;
      // 6e: areturn
      // 6f: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 72: athrow
      // 73: new java/util/LinkedList
      // 76: dup
      // 77: invokespecial java/util/LinkedList.<init> ()V
      // 7a: astore 6
      // 7c: aload 3
      // 7d: invokeinterface java/lang/Iterable.iterator ()Ljava/util/Iterator; 1
      // 82: astore 7
      // 84: aload 7
      // 86: invokeinterface java/util/Iterator.hasNext ()Z 1
      // 8b: ifeq f2
      // 8e: aload 7
      // 90: invokeinterface java/util/Iterator.next ()Ljava/lang/Object; 1
      // 95: checkcast com/l7tech/objectmodel/OrganizationHeader
      // 98: astore 8
      // 9a: aload 4
      // 9c: aload 8
      // 9e: invokeinterface com/l7tech/server/EntityFinder.find (Lcom/l7tech/objectmodel/EntityHeader;)Lcom/l7tech/objectmodel/Entity; 2
      // a3: astore 9
      // a5: aload 9
      // a7: ifnonnull ad
      // aa: goto 84
      // ad: goto d1
      // b0: astore 10
      // b2: getstatic com/l7tech/server/security/rbac/RbacServicesImpl.a Ljava/util/logging/Logger;
      // b5: getstatic java/util/logging/Level.WARNING Ljava/util/logging/Level;
      // b8: getstatic com/l7tech/server/security/rbac/RbacServicesImpl.h [Ljava/lang/String;
      // bb: bipush 2
      // bc: aaload
      // bd: bipush 1
      // be: anewarray 74
      // c1: dup
      // c2: bipush 0
      // c3: aload 8
      // c5: aastore
      // c6: invokestatic java/text/MessageFormat.format (Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
      // c9: aload 10
      // cb: invokevirtual java/util/logging/Logger.log (Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/Throwable;)V
      // ce: goto 84
      // d1: aload 0
      // d2: aload 5
      // d4: aload 9
      // d6: aload 2
      // d7: aconst_null
      // d8: invokevirtual com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/util/Collection;Lcom/l7tech/objectmodel/Entity;Lcom/l7tech/gateway/common/security/rbac/OperationType;Ljava/lang/String;)Z
      // db: ifeq ef
      // de: aload 6
      // e0: aload 8
      // e2: invokeinterface java/util/List.add (Ljava/lang/Object;)Z 2
      // e7: pop
      // e8: goto ef
      // eb: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // ee: athrow
      // ef: goto 84
      // f2: aload 6
      // f4: areturn
      // try (48 -> 53): 53 com/l7tech/objectmodel/FindException
      // try (29 -> 40): 40 com/l7tech/objectmodel/FindException
      // try (23 -> 35): 36 com/l7tech/objectmodel/FindException
      // try (10 -> 21): 21 com/l7tech/objectmodel/FindException
      // try (8 -> 14): 15 com/l7tech/objectmodel/FindException
      // try (0 -> 6): 6 com/l7tech/objectmodel/FindException
      // try (69 -> 75): 77 com/l7tech/objectmodel/FindException
      // try (93 -> 104): 105 com/l7tech/objectmodel/FindException
   }

   @Override
   public boolean isAdministrativeUser(@NotNull Pair<Goid, String> param1, @NotNull User param2) throws FindException {
      // $VF: Couldn't be decompiled
      // Please report this to the Vineflower issue tracker, at https://github.com/Vineflower/vineflower/issues with a copy of the class file (if you have the rights to distribute it!)
      // java.lang.RuntimeException: parsing failure!
      //   at org.jetbrains.java.decompiler.modules.decompiler.decompose.DomHelper.parseGraph(DomHelper.java:211)
      //   at org.jetbrains.java.decompiler.main.rels.MethodProcessor.codeToJava(MethodProcessor.java:174)
      //
      // Bytecode:
      // 000: aload 1
      // 001: ifnonnull 00f
      // 004: bipush 0
      // 005: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (I)V
      // 008: goto 00f
      // 00b: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 00e: athrow
      // 00f: aload 2
      // 010: ifnonnull 01e
      // 013: bipush 1
      // 014: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (I)V
      // 017: goto 01e
      // 01a: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 01d: athrow
      // 01e: aload 2
      // 01f: invokeinterface com/l7tech/identity/User.getId ()Ljava/lang/String; 1
      // 024: ifnonnull 039
      // 027: new java/lang/NullPointerException
      // 02a: dup
      // 02b: getstatic com/l7tech/server/security/rbac/RbacServicesImpl.h [Ljava/lang/String;
      // 02e: bipush 27
      // 030: aaload
      // 031: invokespecial java/lang/NullPointerException.<init> (Ljava/lang/String;)V
      // 034: athrow
      // 035: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 038: athrow
      // 039: aload 2
      // 03a: invokeinterface com/l7tech/identity/User.getId ()Ljava/lang/String; 1
      // 03f: aload 1
      // 040: getfield com/l7tech/util/Pair.right Ljava/lang/Object;
      // 043: invokevirtual java/lang/String.equals (Ljava/lang/Object;)Z
      // 046: ifne 05b
      // 049: new java/lang/IllegalArgumentException
      // 04c: dup
      // 04d: getstatic com/l7tech/server/security/rbac/RbacServicesImpl.h [Ljava/lang/String;
      // 050: bipush 6
      // 052: aaload
      // 053: invokespecial java/lang/IllegalArgumentException.<init> (Ljava/lang/String;)V
      // 056: athrow
      // 057: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 05a: athrow
      // 05b: aload 2
      // 05c: invokeinterface com/l7tech/identity/User.getProviderId ()Lcom/l7tech/objectmodel/Goid; 1
      // 061: aload 1
      // 062: getfield com/l7tech/util/Pair.left Ljava/lang/Object;
      // 065: invokevirtual com/l7tech/objectmodel/Goid.equals (Ljava/lang/Object;)Z
      // 068: ifne 07d
      // 06b: new java/lang/IllegalArgumentException
      // 06e: dup
      // 06f: getstatic com/l7tech/server/security/rbac/RbacServicesImpl.h [Ljava/lang/String;
      // 072: bipush 19
      // 074: aaload
      // 075: invokespecial java/lang/IllegalArgumentException.<init> (Ljava/lang/String;)V
      // 078: athrow
      // 079: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 07c: athrow
      // 07d: bipush 0
      // 07e: istore 3
      // 07f: aload 0
      // 080: getfield com/l7tech/server/security/rbac/RbacServicesImpl.d Lcom/l7tech/server/security/rbac/RoleManager;
      // 083: aload 2
      // 084: bipush 0
      // 085: bipush 1
      // 086: invokeinterface com/l7tech/server/security/rbac/RoleManager.getAssignedRoles (Lcom/l7tech/identity/User;ZZ)Ljava/util/Collection; 4
      // 08b: astore 4
      // 08d: aload 4
      // 08f: invokeinterface java/util/Collection.iterator ()Ljava/util/Iterator; 1
      // 094: astore 5
      // 096: aload 5
      // 098: invokeinterface java/util/Iterator.hasNext ()Z 1
      // 09d: ifeq 0f3
      // 0a0: aload 5
      // 0a2: invokeinterface java/util/Iterator.next ()Ljava/lang/Object; 1
      // 0a7: checkcast com/l7tech/gateway/common/security/rbac/Role
      // 0aa: astore 6
      // 0ac: aload 6
      // 0ae: invokevirtual com/l7tech/gateway/common/security/rbac/Role.getPermissions ()Ljava/util/Set;
      // 0b1: invokeinterface java/util/Set.iterator ()Ljava/util/Iterator; 1
      // 0b6: astore 7
      // 0b8: aload 7
      // 0ba: invokeinterface java/util/Iterator.hasNext ()Z 1
      // 0bf: ifeq 0f0
      // 0c2: aload 7
      // 0c4: invokeinterface java/util/Iterator.next ()Ljava/lang/Object; 1
      // 0c9: checkcast com/l7tech/gateway/common/security/rbac/Permission
      // 0cc: astore 8
      // 0ce: aload 8
      // 0d0: invokevirtual com/l7tech/gateway/common/security/rbac/Permission.getEntityType ()Lcom/l7tech/objectmodel/EntityType;
      // 0d3: ifnull 0ed
      // 0d6: aload 8
      // 0d8: invokevirtual com/l7tech/gateway/common/security/rbac/Permission.getOperation ()Lcom/l7tech/gateway/common/security/rbac/OperationType;
      // 0db: getstatic com/l7tech/gateway/common/security/rbac/OperationType.NONE Lcom/l7tech/gateway/common/security/rbac/OperationType;
      // 0de: if_acmpeq 0ed
      // 0e1: goto 0e8
      // 0e4: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 0e7: athrow
      // 0e8: bipush 1
      // 0e9: istore 3
      // 0ea: goto 0f3
      // 0ed: goto 0b8
      // 0f0: goto 096
      // 0f3: goto 128
      // 0f6: astore 4
      // 0f8: getstatic com/l7tech/server/security/rbac/RbacServicesImpl.a Ljava/util/logging/Logger;
      // 0fb: getstatic java/util/logging/Level.INFO Ljava/util/logging/Level;
      // 0fe: aload 2
      // 0ff: invokeinterface com/l7tech/identity/User.getLogin ()Ljava/lang/String; 1
      // 104: aload 4
      // 106: invokestatic com/l7tech/util/ExceptionUtils.getMessage (Ljava/lang/Throwable;)Ljava/lang/String;
      // 109: getstatic com/l7tech/server/security/rbac/RbacServicesImpl.h [Ljava/lang/String;
      // 10c: astore 9
      // 10e: aload 9
      // 110: bipush 10
      // 112: aaload
      // 113: dup_x2
      // 114: pop
      // 115: aload 9
      // 117: bipush 29
      // 119: aaload
      // 11a: swap
      // 11b: invokedynamic makeConcatWithConstants (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; bsm=java/lang/invoke/StringConcatFactory.makeConcatWithConstants (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite; args=[ "\u0001\u0001\u0001\u0001" ]
      // 120: aload 4
      // 122: invokestatic com/l7tech/util/ExceptionUtils.getDebugException (Ljava/lang/Throwable;)Ljava/lang/Throwable;
      // 125: invokevirtual java/util/logging/Logger.log (Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/Throwable;)V
      // 128: iload 3
      // 129: ifne 14a
      // 12c: aload 0
      // 12d: aload 2
      // 12e: invokeinterface com/l7tech/identity/User.getProviderId ()Lcom/l7tech/objectmodel/Goid; 1
      // 133: invokevirtual com/l7tech/server/security/rbac/RbacServicesImpl.a (Lcom/l7tech/objectmodel/Goid;)Lcom/l7tech/gateway/common/security/rbac/Role;
      // 136: ifnull 148
      // 139: goto 140
      // 13c: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 13f: athrow
      // 140: bipush 1
      // 141: goto 149
      // 144: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 147: athrow
      // 148: bipush 0
      // 149: istore 3
      // 14a: iload 3
      // 14b: ireturn
      // try (86 -> 93): 94 com/l7tech/server/security/rbac/RoleManager$DisabledGroupRolesException
      // try (41 -> 54): 54 com/l7tech/server/security/rbac/RoleManager$DisabledGroupRolesException
      // try (26 -> 39): 39 com/l7tech/server/security/rbac/RoleManager$DisabledGroupRolesException
      // try (14 -> 24): 24 com/l7tech/server/security/rbac/RoleManager$DisabledGroupRolesException
      // try (7 -> 11): 12 com/l7tech/server/security/rbac/RoleManager$DisabledGroupRolesException
      // try (0 -> 4): 5 com/l7tech/server/security/rbac/RoleManager$DisabledGroupRolesException
      // try (58 -> 101): 102 com/l7tech/server/security/rbac/RoleManager$DisabledGroupRolesException
      // try (124 -> 131): 132 com/l7tech/server/security/rbac/RoleManager$DisabledGroupRolesException
      // try (126 -> 136): 136 com/l7tech/server/security/rbac/RoleManager$DisabledGroupRolesException
   }

   private Role a(Goid var1) throws FindException {
      try {
         if (this.g == null) {
            return null;
         }
      } catch (FindException var7) {
         throw a(var7);
      }

      IdentityProviderFactory var2 = (IdentityProviderFactory)this.g.getBean(h[15], IdentityProviderFactory.class);
      if (var2.getProvider(var1) instanceof HasDefaultRole var4) {
         Goid var5 = var4.getDefaultRoleId();

         try {
            if (var5 != null) {
               return (Role)this.d.findByPrimaryKey(var5);
            }
         } catch (FindException var6) {
            throw a(var6);
         }
      }

      return null;
   }

   @Override
   public Collection<Role> getAssignedRoles(@NotNull Pair<Goid, String> var1, @NotNull User var2) throws FindException {
      try {
         if (var1 == null) {
            a(2);
         }
      } catch (FindException var10) {
         throw a(var10);
      }

      try {
         if (var2 == null) {
            a(3);
         }
      } catch (FindException var7) {
         throw a(var7);
      }

      try {
         if (var2.getId() == null) {
            throw new NullPointerException(h[3]);
         }
      } catch (FindException var9) {
         throw a(var9);
      }

      try {
         if (!var2.getId().equals(var1.right)) {
            throw new IllegalArgumentException(h[0]);
         }
      } catch (FindException var6) {
         throw a(var6);
      }

      try {
         if (!var2.getProviderId().equals(var1.left)) {
            throw new IllegalArgumentException(h[12]);
         }
      } catch (FindException var8) {
         throw a(var8);
      }

      ArrayList var3 = new ArrayList();
      var3.addAll(this.d.getAssignedRoles(var2));
      if (var3.isEmpty()) {
         Role var4 = this.a(var2.getProviderId());

         try {
            if (var4 != null) {
               var3.add(var4);
            }
         } catch (FindException var5) {
            throw a(var5);
         }
      }

      return Collections.unmodifiableCollection(var3);
   }

   private static Pair<Goid, String> a(User var0) {
      return new Pair(var0.getProviderId(), var0.getId());
   }

   private boolean a(Collection<Role> param1, Entity param2, OperationType param3, String param4) {
      // $VF: Couldn't be decompiled
      // Please report this to the Vineflower issue tracker, at https://github.com/Vineflower/vineflower/issues with a copy of the class file (if you have the rights to distribute it!)
      // java.lang.RuntimeException: parsing failure!
      //   at org.jetbrains.java.decompiler.modules.decompiler.decompose.DomHelper.parseGraph(DomHelper.java:211)
      //   at org.jetbrains.java.decompiler.main.rels.MethodProcessor.codeToJava(MethodProcessor.java:174)
      //
      // Bytecode:
      // 000: aload 2
      // 001: ifnull 0cd
      // 004: aload 0
      // 005: getfield com/l7tech/server/security/rbac/RbacServicesImpl.f Lcom/l7tech/server/security/rbac/ProtectedEntityTracker;
      // 008: ifnull 0cd
      // 00b: goto 012
      // 00e: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 011: athrow
      // 012: getstatic com/l7tech/gateway/common/security/rbac/OperationType.READ Lcom/l7tech/gateway/common/security/rbac/OperationType;
      // 015: aload 3
      // 016: invokevirtual com/l7tech/gateway/common/security/rbac/OperationType.equals (Ljava/lang/Object;)Z
      // 019: ifne 0cd
      // 01c: goto 023
      // 01f: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 022: athrow
      // 023: aload 0
      // 024: getfield com/l7tech/server/security/rbac/RbacServicesImpl.f Lcom/l7tech/server/security/rbac/ProtectedEntityTracker;
      // 027: invokevirtual com/l7tech/server/security/rbac/ProtectedEntityTracker.isEntityProtectionEnabled ()Z
      // 02a: ifeq 0cd
      // 02d: goto 034
      // 030: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 033: athrow
      // 034: aload 0
      // 035: getfield com/l7tech/server/security/rbac/RbacServicesImpl.f Lcom/l7tech/server/security/rbac/ProtectedEntityTracker;
      // 038: aload 2
      // 039: invokevirtual com/l7tech/server/security/rbac/ProtectedEntityTracker.isReadOnlyEntity (Lcom/l7tech/objectmodel/Entity;)Z
      // 03c: ifeq 0cd
      // 03f: goto 046
      // 042: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 045: athrow
      // 046: getstatic com/l7tech/server/security/rbac/RbacServicesImpl.a Ljava/util/logging/Logger;
      // 049: getstatic java/util/logging/Level.FINEST Ljava/util/logging/Level;
      // 04c: invokevirtual java/util/logging/Logger.isLoggable (Ljava/util/logging/Level;)Z
      // 04f: ifeq 0cb
      // 052: goto 059
      // 055: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 058: athrow
      // 059: getstatic com/l7tech/server/security/rbac/RbacServicesImpl.a Ljava/util/logging/Logger;
      // 05c: getstatic java/util/logging/Level.FINEST Ljava/util/logging/Level;
      // 05f: getstatic com/l7tech/gateway/common/security/rbac/OperationType.OTHER Lcom/l7tech/gateway/common/security/rbac/OperationType;
      // 062: aload 3
      // 063: invokevirtual com/l7tech/gateway/common/security/rbac/OperationType.equals (Ljava/lang/Object;)Z
      // 066: ifeq 08d
      // 069: goto 070
      // 06c: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 06f: athrow
      // 070: getstatic com/l7tech/gateway/common/security/rbac/OperationType.OTHER Lcom/l7tech/gateway/common/security/rbac/OperationType;
      // 073: invokevirtual com/l7tech/gateway/common/security/rbac/OperationType.name ()Ljava/lang/String;
      // 076: aload 4
      // 078: getstatic com/l7tech/server/security/rbac/RbacServicesImpl.h [Ljava/lang/String;
      // 07b: bipush 20
      // 07d: aaload
      // 07e: swap
      // 07f: ldc "]"
      // 081: invokedynamic makeConcatWithConstants (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; bsm=java/lang/invoke/StringConcatFactory.makeConcatWithConstants (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite; args=[ "\u0001\u0001\u0001\u0001" ]
      // 086: goto 091
      // 089: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 08c: athrow
      // 08d: aload 3
      // 08e: invokevirtual com/l7tech/gateway/common/security/rbac/OperationType.name ()Ljava/lang/String;
      // 091: aload 2
      // 092: invokeinterface com/l7tech/objectmodel/Entity.getId ()Ljava/lang/String; 1
      // 097: aload 2
      // 098: invokeinterface com/l7tech/objectmodel/Entity.getClass ()Ljava/lang/Class; 1
      // 09d: invokestatic com/l7tech/objectmodel/EntityType.findTypeByEntity (Ljava/lang/Class;)Lcom/l7tech/objectmodel/EntityType;
      // 0a0: invokevirtual com/l7tech/objectmodel/EntityType.name ()Ljava/lang/String;
      // 0a3: astore 9
      // 0a5: astore 10
      // 0a7: astore 11
      // 0a9: getstatic com/l7tech/server/security/rbac/RbacServicesImpl.h [Ljava/lang/String;
      // 0ac: astore 12
      // 0ae: aload 12
      // 0b0: bipush 26
      // 0b2: aaload
      // 0b3: aload 11
      // 0b5: aload 12
      // 0b7: bipush 8
      // 0b9: aaload
      // 0ba: aload 10
      // 0bc: aload 12
      // 0be: bipush 18
      // 0c0: aaload
      // 0c1: aload 9
      // 0c3: invokedynamic makeConcatWithConstants (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; bsm=java/lang/invoke/StringConcatFactory.makeConcatWithConstants (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite; args=[ "\u0001\u0001\u0001\u0001\u0001\u0001" ]
      // 0c8: invokevirtual java/util/logging/Logger.log (Ljava/util/logging/Level;Ljava/lang/String;)V
      // 0cb: bipush 0
      // 0cc: ireturn
      // 0cd: aload 1
      // 0ce: invokeinterface java/util/Collection.iterator ()Ljava/util/Iterator; 1
      // 0d3: astore 5
      // 0d5: aload 5
      // 0d7: invokeinterface java/util/Iterator.hasNext ()Z 1
      // 0dc: ifeq 16e
      // 0df: aload 5
      // 0e1: invokeinterface java/util/Iterator.next ()Ljava/lang/Object; 1
      // 0e6: checkcast com/l7tech/gateway/common/security/rbac/Role
      // 0e9: astore 6
      // 0eb: aload 6
      // 0ed: invokevirtual com/l7tech/gateway/common/security/rbac/Role.getPermissions ()Ljava/util/Set;
      // 0f0: invokeinterface java/util/Set.iterator ()Ljava/util/Iterator; 1
      // 0f5: astore 7
      // 0f7: aload 7
      // 0f9: invokeinterface java/util/Iterator.hasNext ()Z 1
      // 0fe: ifeq 16b
      // 101: aload 7
      // 103: invokeinterface java/util/Iterator.next ()Ljava/lang/Object; 1
      // 108: checkcast com/l7tech/gateway/common/security/rbac/Permission
      // 10b: astore 8
      // 10d: aload 8
      // 10f: aload 2
      // 110: invokevirtual com/l7tech/gateway/common/security/rbac/Permission.matches (Lcom/l7tech/objectmodel/Entity;)Z
      // 113: ifeq 0f7
      // 116: aload 8
      // 118: invokevirtual com/l7tech/gateway/common/security/rbac/Permission.getOperation ()Lcom/l7tech/gateway/common/security/rbac/OperationType;
      // 11b: aload 3
      // 11c: if_acmpeq 126
      // 11f: goto 0f7
      // 122: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 125: athrow
      // 126: aload 0
      // 127: aload 2
      // 128: aload 8
      // 12a: invokevirtual com/l7tech/server/security/rbac/RbacServicesImpl.a (Lcom/l7tech/objectmodel/Entity;Lcom/l7tech/gateway/common/security/rbac/Permission;)Z
      // 12d: ifne 137
      // 130: goto 0f7
      // 133: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 136: athrow
      // 137: aload 3
      // 138: getstatic com/l7tech/gateway/common/security/rbac/OperationType.OTHER Lcom/l7tech/gateway/common/security/rbac/OperationType;
      // 13b: if_acmpeq 14c
      // 13e: aload 3
      // 13f: getstatic com/l7tech/gateway/common/security/rbac/OperationType.NONE Lcom/l7tech/gateway/common/security/rbac/OperationType;
      // 142: if_acmpne 166
      // 145: goto 14c
      // 148: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 14b: athrow
      // 14c: aload 4
      // 14e: aload 8
      // 150: invokevirtual com/l7tech/gateway/common/security/rbac/Permission.getOtherOperationName ()Ljava/lang/String;
      // 153: invokevirtual java/lang/String.equals (Ljava/lang/Object;)Z
      // 156: ifeq 168
      // 159: goto 160
      // 15c: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 15f: athrow
      // 160: bipush 1
      // 161: ireturn
      // 162: invokestatic com/l7tech/server/security/rbac/RbacServicesImpl.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 165: athrow
      // 166: bipush 1
      // 167: ireturn
      // 168: goto 0f7
      // 16b: goto 0d5
      // 16e: bipush 0
      // 16f: ireturn
      // try (0 -> 5): 6 java/lang/IllegalArgumentException
      // try (2 -> 12): 13 java/lang/IllegalArgumentException
      // try (8 -> 19): 20 java/lang/IllegalArgumentException
      // try (15 -> 27): 28 java/lang/IllegalArgumentException
      // try (22 -> 34): 35 java/lang/IllegalArgumentException
      // try (30 -> 43): 44 java/lang/IllegalArgumentException
      // try (37 -> 56): 56 java/lang/IllegalArgumentException
      // try (112 -> 117): 117 java/lang/IllegalArgumentException
      // try (119 -> 125): 125 java/lang/IllegalArgumentException
      // try (127 -> 133): 134 java/lang/IllegalArgumentException
      // try (130 -> 141): 142 java/lang/IllegalArgumentException
      // try (136 -> 146): 146 java/lang/IllegalArgumentException
   }

   private boolean a(Entity var1, Permission var2) {
      try {
         if (var2.getScope().isEmpty()) {
            return true;
         }
      } catch (IllegalArgumentException var6) {
         throw a(var6);
      }

      boolean var3 = true;

      for (ScopePredicate var5 : var2.getScope()) {
         var3 &= this.a(var5, var1);
      }

      return var3;
   }

   private boolean a(ScopePredicate var1, Entity var2) {
      if (!(var1 instanceof ScopeEvaluator var3)) {
         var3 = this.c.get(var1);
         if (var3 == null) {
            ScopeEvaluatorFactory var4 = this.b.get(var1.getClass());

            try {
               if (var4 == null) {
                  throw new IllegalStateException(h[25] + var1.getClass().getName());
               }
            } catch (IllegalArgumentException var7) {
               throw a(var7);
            }

            var3 = var4.makeEvaluator(var1);

            try {
               if (var3 == null) {
                  throw new IllegalStateException(var4.getClass().getName() + h[1]);
               }
            } catch (IllegalArgumentException var6) {
               throw a(var6);
            }

            this.c.put(var1, var3);
         }
      }

      try {
         if (var3.matches(var2)) {
            return true;
         }
      } catch (IllegalArgumentException var5) {
         throw a(var5);
      }

      a.fine(String.format(h[23], var3.getClass().getSimpleName()));
      return false;
   }

   public void setRoleManager(RoleManager var1) {
      this.d = var1;
   }

   public void setEntityFinder(EntityFinder var1) {
      this.e = var1;
   }

   public void setProtectedEntityTracker(ProtectedEntityTracker var1) {
      this.f = var1;
   }

   public void afterPropertiesSet() throws Exception {
      try {
         if (this.d == null) {
            throw new IllegalStateException(h[5]);
         }
      } catch (Exception var2) {
         throw a(var2);
      }

      try {
         if (this.e == null) {
            throw new IllegalStateException(h[24]);
         }
      } catch (Exception var1) {
         throw a(var1);
      }
   }

   @Override
   public void onApplicationEvent(ApplicationEvent var1) {
      if (var1 instanceof EntityInvalidationEvent var2 && Role.class.isAssignableFrom(var2.getEntityClass())) {
         for (Goid var6 : var2.getEntityIds()) {
            try {
               this.d.getCachedEntity(var6, 0);
            } catch (Exception var8) {
               a.log(Level.WARNING, h[28], var8);
            }
         }
      }
   }

   public void setApplicationContext(ApplicationContext var1) throws BeansException {
      this.g = var1;
   }

   static {
      String[] var5 = new String[30];
      int var3 = 0;
      String var2 = "Hh\u0018KsT\u0012\u001dv\u0014J>|\"^s\u001a\u001dk\u000fV7h5X\u007f]Xss#Qw]\\%|:Hz\tV!/hu\u001c[?xvIt]_:s2\u001d~\u0013M:i/\u001d}\u0012Ksu3\\\u007f\u0018Ki=-\rfF\u0019 v?Mk\u0014W4\u0007Hh\u0018KsT\u0012\u0014Th<]>t8Th\tK2i?K~(J6o\u0017ot\u0011\\\u001e|8\\|\u0018Kst%\u001di\u0018H&t$X\u007f\u0010Hh\u0018KsT\u0012\u001dv\u0014J>|\"^s&~s\u0018Z8t8Z;\u001bV!=&Xi\u0010P n?Ru]M<=-\rf]X=dvF*\u0000\u001d\u001dz\u001eZ6n%\u001do\u0012\u0019\u0001x7Y62W?dvxu\tP'dl\u001d\u0004Hh\u0018K\u001b|\u007f\u0010P=t%Ii\u001cM:k3\u001dz\u001eZ6n%\u001d}\u0012Ks:\u0010Z~\tx n?Zu\u0018]\u0001r:Xh\u0014Mi\u0012O:y3O;4}sp?Nv\u001cM0u<Ro\u0015\\!R&Xi\u001cM:r8sz\u0010\\sp#No][6=%M~\u001eP5t3Y;\nQ6svRk\u0018K2i?Ru]\u0004n=\u0019iS8k0^t\u0010\u0016?*\"Xx\u0015\u0016 x$K~\u000f\u0016 x5Hi\u0014M*2$_z\u001e\u0016\u0001\u007f7^H\u0018K%t5Xh4T#q\u0017T\u007f\u0018W't\"DK\u000fV%t2Xi;X0i9Ob>|i\u001aL>x8I;\u001bV!=\u0016st\tw&q:\u001dk\u001cK2p3I~\u000f\u0019t8%\u001a;\u0012_s8%\u0013>\u000e\u0019>h%I;\u0013V'=4X;\u0013L?q$~s\u0018Z8t8Z;\u001bV!=&Xi\u0010P n?Ru]M<=sN;XJs>sN\n\u001dt\u001b\u0019\u0007d&X!]\u0014Mi\u0012O:y3O;4}sp?Nv\u001cM0u\u0002\u0007@\u0011Mi\u0012O:y3OZ\u0013]\u0006n3OR\u0019'~s\u0018Z8t8Z;\u001bV!=&Xi\u0010P n?Ru]M<=-\rf]J<p3\u001d`LD\u001b\u0018h]]:yvSt\t\u0019>|\"^s]M;xvXu\tP'd\u0018xu\tP'd\u0010Tu\u0019\\!=?N;\u000f\\\"h?O~\u0019\u0019st]\\%|:Hz\tV!=0\\x\tV!dv[t\u000f\u0019\by~\u0013@:s1\u001d\u0007Hh\u0018KsT\u0012";
      int var4 = "Hh\u0018KsT\u0012\u001dv\u0014J>|\"^s\u001a\u001dk\u000fV7h5X\u007f]Xss#Qw]\\%|:Hz\tV!/hu\u001c[?xvIt]_:s2\u001d~\u0013M:i/\u001d}\u0012Ksu3\\\u007f\u0018Ki=-\rfF\u0019 v?Mk\u0014W4\u0007Hh\u0018KsT\u0012\u0014Th<]>t8Th\tK2i?K~(J6o\u0017ot\u0011\\\u001e|8\\|\u0018Kst%\u001di\u0018H&t$X\u007f\u0010Hh\u0018KsT\u0012\u001dv\u0014J>|\"^s&~s\u0018Z8t8Z;\u001bV!=&Xi\u0010P n?Ru]M<=-\rf]X=dvF*\u0000\u001d\u001dz\u001eZ6n%\u001do\u0012\u0019\u0001x7Y62W?dvxu\tP'dl\u001d\u0004Hh\u0018K\u001b|\u007f\u0010P=t%Ii\u001cM:k3\u001dz\u001eZ6n%\u001d}\u0012Ks:\u0010Z~\tx n?Zu\u0018]\u0001r:Xh\u0014Mi\u0012O:y3O;4}sp?Nv\u001cM0u<Ro\u0015\\!R&Xi\u001cM:r8sz\u0010\\sp#No][6=%M~\u001eP5t3Y;\nQ6svRk\u0018K2i?Ru]\u0004n=\u0019iS8k0^t\u0010\u0016?*\"Xx\u0015\u0016 x$K~\u000f\u0016 x5Hi\u0014M*2$_z\u001e\u0016\u0001\u007f7^H\u0018K%t5Xh4T#q\u0017T\u007f\u0018W't\"DK\u000fV%t2Xi;X0i9Ob>|i\u001aL>x8I;\u001bV!=\u0016st\tw&q:\u001dk\u001cK2p3I~\u000f\u0019t8%\u001a;\u0012_s8%\u0013>\u000e\u0019>h%I;\u0013V'=4X;\u0013L?q$~s\u0018Z8t8Z;\u001bV!=&Xi\u0010P n?Ru]M<=sN;XJs>sN\n\u001dt\u001b\u0019\u0007d&X!]\u0014Mi\u0012O:y3O;4}sp?Nv\u001cM0u\u0002\u0007@\u0011Mi\u0012O:y3OZ\u0013]\u0006n3OR\u0019'~s\u0018Z8t8Z;\u001bV!=&Xi\u0010P n?Ru]M<=-\rf]J<p3\u001d`LD\u001b\u0018h]]:yvSt\t\u0019>|\"^s]M;xvXu\tP'd\u0018xu\tP'd\u0010Tu\u0019\\!=?N;\u000f\\\"h?O~\u0019\u0019st]\\%|:Hz\tV!=0\\x\tV!dv[t\u000f\u0019\by~\u0013@:s1\u001d\u0007Hh\u0018KsT\u0012"
         .length();
      char var1 = 16;
      int var7 = -1;

      label24:
      while (true) {
         byte var10000 = 43;
         String var10001 = var2.substring(++var7, var7 + var1);
         byte var10002 = -1;

         while (true) {
            String var8 = a(var10000, a(var10001));
            switch (var10002) {
               case 0:
                  var5[var3++] = var8;
                  if ((var7 += var1) >= var4) {
                     h = var5;
                     a = Logger.getLogger(RbacServicesImpl.class.getName());
                     return;
                  }

                  var1 = var2.charAt(var7);
                  break;
               default:
                  var5[var3++] = var8;
                  if ((var7 += var1) < var4) {
                     var1 = var2.charAt(var7);
                     continue label24;
                  }

                  var2 = "q{\u0007Z8|~F4\u0000S:`<A|RU=q1WpRd3~<\u0011\u00154\u0016S2{<V4\u0016C92-].R";
                  var4 = "q{\u0007Z8|~F4\u0000S:`<A|RU=q1WpRd3~<\u0011\u00154\u0016S2{<V4\u0016C92-].R".length();
                  var1 = 28;
                  var7 = -1;
            }

            var10000 = 36;
            var10001 = var2.substring(++var7, var7 + var1);
            var10002 = 0;
         }
      }
   }

   private static Exception a(Exception var0) {
      return var0;
   }

   private static char[] a(String var0) {
      char[] var10000 = var0.toCharArray();
      if (var10000.length < 2) {
         var10000[0] = (char)(var10000[0] ^ 125);
      }

      return var10000;
   }

   private static String a(int var0, char[] var1) {
      int var10003 = var1.length;
      int var10002 = var0;
      char[] var10001 = var1;
      int var10000 = var10003;

      for (int var2 = 0; var10000 > var2; var2++) {
         var10001[var2] = (char)(var10001[var2] ^ var10002 ^ switch (var2 % 7) {
            case 0 -> 22;
            case 1 -> 48;
            case 2 -> 86;
            case 3 -> 18;
            case 4 -> 120;
            case 5 -> 54;
            default -> 125;
         });
      }

      return new String(var10001).intern();
   }
}
