Package org.apache.lenya.ac

Examples of org.apache.lenya.ac.AccessControlException


                DefaultPolicy policy = builder.buildPolicy(stream);
                policy.removeRoles(accreditable);
                savePolicy(policy, policyFiles[i]);
            }
        } catch (Exception e) {
            throw new AccessControlException(e);
        }

        File[] directories = policyDirectory.listFiles((FileFilter)FileFilterUtils.directoryFileFilter());

        for (int i = 0; i < directories.length; i++) {
View Full Code Here


                        getLogger().debug("    Document ID: [" + document.getId() + "]");
                    }
                }
            }
        } catch (Exception e) {
            throw new AccessControlException(e);
        }

        if (url == null) {
            if (getLogger().isDebugEnabled()) {
                getLogger().debug("    Document does not exist.");
View Full Code Here

            File servletContext = SourceUtil.getFile(source);
            getLogger().debug("    Webapp URL:      [" + url + "]");
            getLogger().debug("    Serlvet context: [" + servletContext.getAbsolutePath() + "]");
            publication = PublicationFactory.getPublication(url, servletContext);
        } catch (Exception e) {
            throw new AccessControlException(e);
        } finally {
            if (resolver != null) {
                if (source != null) {
                    resolver.release(source);
                }
View Full Code Here

                    (ServiceSelector) getServiceManager().lookup(PolicyManager.ROLE + "Selector");

                PolicyManager policyManager = (PolicyManager) policyManagerSelector.select(type);

                if (!(policyManager instanceof InheritingPolicyManager)) {
                    throw new AccessControlException(
                        "The "
                            + getClass().getName()
                            + " can only be used with an "
                            + InheritingPolicyManager.class.getName()
                            + ".");
View Full Code Here

    public void removeRole(Accreditable accreditable, Role role) throws AccessControlException {
        assert accreditable != null;
        assert role != null;
        Credential credential = getCredential(accreditable);
        if (credential == null) {
            throw new AccessControlException(
                "No credential for accreditable ["
                    + accreditable
                    + "] ["
                    + accreditableToCredential.keySet().size()
                    + "]");
        }
        if (!credential.contains(role)) {
            throw new AccessControlException(
                "Credential for accreditable ["
                    + accreditable
                    + "] does not contain role ["
                    + role
                    + "]");
View Full Code Here

   * @param credential The credential to remove.
   * @throws AccessControlException If the credential does not exist.
   */
    protected void removeCredential(Credential credential) throws AccessControlException {
        if (!accreditableToCredential.containsValue(credential)) {
            throw new AccessControlException("Credential [" + credential + "] does not exist!");
        }
        accreditableToCredential.remove(credential.getAccreditable());
    }
View Full Code Here

     */
    public static FileIPRangeManager instance(File configurationDirectory) throws AccessControlException {

        assert configurationDirectory != null;
        if (!configurationDirectory.isDirectory()) {
            throw new AccessControlException(
                "Configuration directory [" + configurationDirectory + "] does not exist!");
        }

        if (!instances.containsKey(configurationDirectory)) {
            instances.put(configurationDirectory, new FileIPRangeManager(configurationDirectory));
View Full Code Here

        DefaultAccessController ac = getAccessController(session, pubId);
        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

                DocumentFactory factory = DocumentUtil.getDocumentFactory(manager, request);
                if (pubId != null && factory.existsPublication(pubId)) {
                    publication = factory.getPublication(pubId);
                }
            } catch (Exception e) {
                throw new AccessControlException(e);
            } finally {
                if (util != null) {
                    this.manager.release(util);
                }
            }
View Full Code Here

        if (configurationFile.isFile()) {
            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

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.