Package org.openengsb.core.api.security.service

Examples of org.openengsb.core.api.security.service.AccessDeniedException


            LOGGER.info("is Object-method; skipping");
            return mi.proceed();
        }
        Subject subject = ThreadContext.getSubject();
        if (subject == null || !subject.isAuthenticated()) {
            throw new AccessDeniedException("no authentication was found in context");
        }

        if (subject.getPrincipal().getClass().equals(Object.class)) {
            // this action is executed in a root-context
            return mi.proceed();
        }

        String username = (String) subject.getPrincipal();
        Access decisionResult = authorizer.checkAccess(username, mi);
        if (decisionResult != Access.GRANTED) {
            LOGGER.warn("Access denied because result was {}", decisionResult);
            throw new AccessDeniedException();
        }
        LOGGER.debug("Access was granted");
        return mi.proceed();
    }
View Full Code Here

TOP

Related Classes of org.openengsb.core.api.security.service.AccessDeniedException

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.