Examples of DefaultPolicy


Examples of org.apache.lenya.ac.impl.DefaultPolicy

     */
    public CredentialWrapper[] getCredentials(boolean urlOnly) throws ProcessingException {

        List credentials = new ArrayList();

        DefaultPolicy policies[] = getPolicies(urlOnly);
        List policyCredentials = new ArrayList();
        for (int i = 0; i < policies.length; i++) {
            Credential[] creds = policies[i].getCredentials();
            for (int j = 0; j < creds.length; j++) {
                policyCredentials.add(creds[j]);
View Full Code Here

Examples of org.apache.lenya.ac.impl.DefaultPolicy

        if (getLogger().isDebugEnabled()) {
            getLogger().debug("Building policy for URL [" + url + "]");
        }

        DefaultPolicy policy = null;

        String policyUri = getPolicySourceURI(url, policyFilename);
        if (getLogger().isDebugEnabled()) {
            getLogger().debug("Policy source URI resolved to: " + policyUri);
        }

        try {
            PolicyBuilder builder = new PolicyBuilder(controller);
            policy = (DefaultPolicy) getCache().get(policyUri, builder);
        } catch (CachingException e) {
            throw new AccessControlException(e);
        }

        if (getLogger().isDebugEnabled()) {
            getLogger().debug("Policy exists: [" + (policy != null) + "]");
        }

        if (policy == null) {
            policy = new DefaultPolicy();
        }
        return policy;
    }
View Full Code Here

Examples of org.apache.lenya.ac.impl.DefaultPolicy

                    getLogger().debug(
                            "    File:         [" + policyFiles[i].getAbsolutePath() + "]");
                }

                InputStream stream = new FileInputStream(policyFiles[i]);
                DefaultPolicy policy = builder.buildPolicy(stream);
                policy.removeRoles(accreditable);
                savePolicy(policy, policyFiles[i]);
            }
        } catch (final FileNotFoundException e1) {
            throw new AccessControlException(e1);
        } catch (final AccessControlException e1) {
View Full Code Here

Examples of org.apache.lenya.ac.impl.DefaultPolicy

        if (accreditable instanceof User) {
            Role role = URLPolicy.getAuthorRole(manager);
            if (role != null) {
                String url = USER_ADMIN_URL + ((User) accreditable).getId() + ".html";
                DefaultPolicy policy = buildSubtreePolicy(manager, url);
                Credential credential = policy.getCredential(accreditable);
                if (credential != null && credential.contains(role)) {
                    policy.removeRole(accreditable, role);
                }
                saveSubtreePolicy(url, policy);
            }
        }
    }
View Full Code Here

Examples of org.apache.lenya.ac.impl.DefaultPolicy

            throws AccessControlException {
        if (accreditable instanceof User) {
            Role role = URLPolicy.getAuthorRole(manager);
            if (role != null) {
                String url = USER_ADMIN_URL + ((User) accreditable).getId() + ".html";
                DefaultPolicy policy = buildSubtreePolicy(manager, url);
                policy.addRole(accreditable, role);
                saveSubtreePolicy(url, policy);
            }
        }
    }
View Full Code Here

Examples of org.apache.lenya.ac.impl.DefaultPolicy

        if (getLogger().isDebugEnabled()) {
            getLogger().debug("Building policy for URL [" + url + "]");
        }

        DefaultPolicy policy = null;

        String policyUri = getPolicySourceURI(url, policyFilename);
        if (getLogger().isDebugEnabled()) {
            getLogger().debug("Policy source URI resolved to: " + policyUri);
        }

        try {
            PolicyBuilder builder = new PolicyBuilder(controller);
            policy = (DefaultPolicy) getCache().get(policyUri, builder);
        } catch (CachingException e) {
            throw new AccessControlException(e);
        }

        if (getLogger().isDebugEnabled()) {
            getLogger().debug("Policy exists: [" + (policy != null) + "]");
        }

        if (policy == null) {
            policy = new DefaultPolicy();
        }
        return policy;
    }
View Full Code Here

Examples of org.apache.lenya.ac.impl.DefaultPolicy

        if (getLogger().isDebugEnabled()) {
            getLogger().debug("Building policy for URL [" + url + "]");
        }

        DefaultPolicy policy = null;

        String policyUri = getPolicySourceURI(url, policyFilename);
        if (getLogger().isDebugEnabled()) {
            getLogger().debug("Policy source URI resolved to: " + policyUri);
        }

        try {
            PolicyBuilder builder = new PolicyBuilder(controller);
            policy = (DefaultPolicy) getCache().get(policyUri, builder);
        } catch (CachingException e) {
            throw new AccessControlException(e);
        }

        if (getLogger().isDebugEnabled()) {
            getLogger().debug("Policy exists: [" + (policy != null) + "]");
        }

        if (policy == null) {
            policy = new DefaultPolicy();
        }
        return policy;
    }
View Full Code Here

Examples of org.apache.lenya.ac.impl.DefaultPolicy

                    getLogger().debug(
                        "    File:         [" + policyFiles[i].getAbsolutePath() + "]");
                }

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

Examples of org.apache.lenya.ac.impl.DefaultPolicy

        if (getLogger().isDebugEnabled()) {
            getLogger().debug("Building policy for URL [" + url + "]");
        }

        DefaultPolicy policy = null;

        String policyUri = getPolicySourceURI(url, policyFilename);
        if (getLogger().isDebugEnabled()) {
            getLogger().debug("Policy source URI resolved to: " + policyUri);
        }

        try {
            PolicyBuilder builder = new PolicyBuilder(controller);
            policy = (DefaultPolicy) getCache().get(policyUri, builder);
        } catch (CachingException e) {
            throw new AccessControlException(e);
        }

        if (getLogger().isDebugEnabled()) {
            getLogger().debug("Policy exists: [" + (policy != null) + "]");
        }

        if (policy == null) {
            policy = new DefaultPolicy();
        }
        return policy;
    }
View Full Code Here

Examples of org.apache.lenya.ac.impl.DefaultPolicy

                    getLogger().debug(
                        "    File:         [" + policyFiles[i].getAbsolutePath() + "]");
                }

                InputStream stream = new FileInputStream(policyFiles[i]);
                DefaultPolicy policy = builder.buildPolicy(stream);
                policy.removeRoles(accreditable);
                savePolicy(policy, policyFiles[i]);
            }
        } catch (Exception e) {
            throw new AccessControlException(e);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.