Package be.c4j.ee.security.exception

Examples of be.c4j.ee.security.exception.SecurityViolationInfoProducer


    @Override
    protected void checkPermission(InvocationContext invocationContext, Set<SecurityViolation> violations) {
        try {
            subject.checkPermission(namedPermission);
        } catch (AuthorizationException e) {
            SecurityViolationInfoProducer infoProducer = CodiUtils.getContextualReferenceByClass(SecurityViolationInfoProducer.class);
            violations.add(newSecurityViolation(infoProducer.getViolationInfo(invocationContext, namedPermission)));
        }

    }
View Full Code Here


    @Override
    protected void checkPermission(InvocationContext invocationContext, Set<SecurityViolation> violations) {
        try {
            subject.checkPermission(namedRole);
        } catch (AuthorizationException e) {
            SecurityViolationInfoProducer infoProducer = CodiUtils.getContextualReferenceByClass(SecurityViolationInfoProducer.class);
            violations.add(newSecurityViolation(infoProducer.getViolationInfo(invocationContext, namedRole)));

        }

    }
View Full Code Here

            checkEmployeeOrManagerAccess(invocationContext, violations);
        }


        if (!matchedParameter) {
            SecurityViolationInfoProducer infoProducer = CodiUtils.getContextualReferenceByClass(SecurityViolationInfoProducer.class);
            violations.add(newSecurityViolation(infoProducer.getWrongOverloadingMethodSignatureInfo(invocationContext, UserPrincipal.class, Long.class)));


        }

    }
View Full Code Here

        if (!allowed && employeeReadAllPermission.verifyPermission()) {
            allowed = true;
        }

        if (!allowed) {
            SecurityViolationInfoProducer infoProducer = CodiUtils.getContextualReferenceByClass(SecurityViolationInfoProducer.class);
            violations.add(newSecurityViolation(infoProducer.getViolationInfo(invocationContext, newSecurityViolation("Employees can only view their own card or manager of the employee"))));
        }
    }
View Full Code Here

    }

    private void checkEmployeeAccess(InvocationContext invocationContext, Set<SecurityViolation> violations) {
        UserPrincipal parameter = methodParameterCheckUtil.getAssignableParameter(invocationContext, UserPrincipal.class);
        if (!userPrincipal.equals(parameter)) {
            SecurityViolationInfoProducer infoProducer = CodiUtils.getContextualReferenceByClass(SecurityViolationInfoProducer.class);
            violations.add(newSecurityViolation(infoProducer.getViolationInfo(invocationContext, newSecurityViolation("Employees can only view their own card"))));
        }

    }
View Full Code Here

TOP

Related Classes of be.c4j.ee.security.exception.SecurityViolationInfoProducer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.