/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.gateway.common.security.rbac.OperationType
 *  com.l7tech.gateway.common.security.rbac.PermissionDeniedException
 *  com.l7tech.identity.User
 *  com.l7tech.objectmodel.Entity
 *  com.l7tech.objectmodel.FindException
 *  com.l7tech.policy.AssertionAccess
 *  com.l7tech.policy.assertion.Assertion
 *  com.l7tech.util.Functions$UnaryVoid
 */
package com.l7tech.server.policy;

import com.l7tech.gateway.common.security.rbac.OperationType;
import com.l7tech.gateway.common.security.rbac.PermissionDeniedException;
import com.l7tech.identity.User;
import com.l7tech.objectmodel.Entity;
import com.l7tech.objectmodel.FindException;
import com.l7tech.policy.AssertionAccess;
import com.l7tech.policy.assertion.Assertion;
import com.l7tech.server.policy.PolicyAssertionRbacCheckerImpl;
import com.l7tech.util.Functions;

class g
implements Functions.UnaryVoid<Assertion> {
    final User val$user;
    final PermissionDeniedException[] val$permErr;
    final FindException[] val$findErr;
    final PolicyAssertionRbacCheckerImpl this$0;

    /*
     * Ignored method signature, as it can't be verified against descriptor
     */
    g(PolicyAssertionRbacCheckerImpl policyAssertionRbacCheckerImpl, User user, PermissionDeniedException[] permissionDeniedExceptionArray, FindException[] findExceptionArray) {
        this.this$0 = policyAssertionRbacCheckerImpl;
        this.val$user = user;
        this.val$permErr = permissionDeniedExceptionArray;
        this.val$findErr = findExceptionArray;
    }

    /*
     * Loose catch block
     */
    public void call(Assertion assertion) {
        block9: {
            AssertionAccess assertionAccess = this.this$0.assertionAccessManager.getAssertionAccessCached(assertion);
            try {
                if (this.this$0.rbacServices.isPermittedForEntity(this.val$user, (Entity)assertionAccess, OperationType.READ, null)) break block9;
                try {
                    block10: {
                        if (this.val$permErr[0] != null) break block9;
                        break block10;
                        catch (FindException findException) {
                            throw g.a(findException);
                        }
                    }
                    this.val$permErr[0] = new PermissionDeniedException(OperationType.READ, (Entity)assertionAccess, null);
                }
                catch (FindException findException) {
                    throw g.a(findException);
                }
            }
            catch (FindException findException) {
                try {
                    if (this.val$findErr[0] == null) {
                        this.val$findErr[0] = findException;
                    }
                }
                catch (FindException findException2) {
                    throw g.a(findException2);
                }
            }
        }
    }

    private static FindException a(FindException findException) {
        return findException;
    }
}

