Package org.apache.lenya.ac

Examples of org.apache.lenya.ac.AccessControlException


        UsecaseRolesBuilder builder = new UsecaseRolesBuilder();
        UsecaseRoles usecaseRoles;
        try {
            usecaseRoles = (UsecaseRoles) getCache().get(_configurationUri, builder);
        } catch (CachingException e) {
            throw new AccessControlException(e);
        }
        return usecaseRoles;
    }
View Full Code Here


            try {
                Configuration configuration = new DefaultConfigurationBuilder()
                        .buildFromFile(configurationFile);
                return configuration;
            } catch (Exception e) {
                throw new AccessControlException(e);
            }
        } else {
            throw new AccessControlException("No such file or directory: " + configurationFile);
        }
    }
View Full Code Here

                    getLogger().debug("    Document exists");
                    getLogger().debug("    Document path: [" + authoringDoc.getPath() + "]");
                }
            }
        } catch (ServiceException e) {
            throw new AccessControlException("Error looking up ContextUtility component", e);
        } catch (Exception e) {
            throw new AccessControlException(e);
        } finally {
            if (contextUtility != null) {
                serviceManager.release(contextUtility);
            }
        }
View Full Code Here

            util = (ContextUtility) this.serviceManager.lookup(ContextUtility.ROLE);
            Request request = util.getRequest();
            DocumentFactory factory = DocumentUtil.getDocumentFactory(this.serviceManager, request);
            return PublicationUtil.getPublicationFromUrl(this.serviceManager, factory, url);
        } catch (Exception e) {
            throw new AccessControlException(e);
        } finally {
            if (util != null) {
                this.serviceManager.release(util);
            }
        }
View Full Code Here

                PolicyManager _policyManager = (PolicyManager) this.policyManagerSelector
                        .select(type);

                if (!(_policyManager instanceof InheritingPolicyManager)) {
                    throw new AccessControlException("The " + getClass().getName()
                            + " can only be used with an "
                            + InheritingPolicyManager.class.getName() + ".");
                }

                DefaultAccessController.configureOrParameterize(_policyManager,
View Full Code Here

        DefaultAccessController ac = getAccessController(session, TEST_PUB_ID);
        AccreditableManager acMgr = ac.getAccreditableManager();
        User user = acMgr.getUserManager().getUser(userId);

        if (user == null) {
            throw new AccessControlException("The user [" + userId + "] does not exist!");
        }

        ac.setupIdentity(getRequest());

        org.apache.cocoon.environment.Session cocoonSession = getRequest().getSession();
View Full Code Here

            for (Enumeration e = request.getParameterNames(); e.hasMoreElements();) {
                String key = (String) e.nextElement();
                buf.append("    Parameter: [" + key + "] = [" + request.getParameter(key) + "]\n");
            }

            throw new AccessControlException("Request [" + request + "] does not contain roles: \n"
                    + buf.toString());
        }

        Role[] roles = (Role[]) roleList.toArray(new Role[roleList.size()]);
        return roles;
View Full Code Here

            AccreditableManager accreditableManager = controller.getAccreditableManager();
            UserManager userManager = accreditableManager.getUserManager();
           
            return userManager.getUser(userId);
        } catch (ServiceException e) {
            throw new AccessControlException(e);
        } finally {
            if (selector != null) {
                if (resolver != null) {
                    if (controller != null) {
                        resolver.release(controller);
View Full Code Here

                }
            }

            return (User[]) usersWithRole.toArray(new User[usersWithRole.size()]);
        } catch (ServiceException e) {
            throw new AccessControlException(e);
        } finally {
            if (selector != null) {
                if (resolver != null) {
                    if (controller != null) {
                        resolver.release(controller);
View Full Code Here

        boolean authorized = false;

        UsecaseRoles usecaseRoles = getUsecaseRoles(_configurationUri);

        if (usecaseRoles == null) {
            throw new AccessControlException("Usecase policies configuration not found at ["
                    + _configurationUri + "]");
        }

        if (usecaseRoles.hasRoles(usecase)) {
            getLogger().debug("Roles for usecase found.");
View Full Code Here

TOP

Related Classes of org.apache.lenya.ac.AccessControlException

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.