Package org.apache.lenya.ac

Examples of org.apache.lenya.ac.ModifiablePolicy


                        }
                        if (!role.isAssignable()) {
                            addErrorMessage("cannot-assign-role", new String[] { roleId });
                        }
                        if (operations[j].equals(ADD)) {
                            ModifiablePolicy policy = getPolicy();
                            if (containsCredential(policy, item, role)) {
                                addErrorMessage("credential-already-contained", new String[] {
                                        ((Item) item).getId(), role.getId() });
                            }
                        }
View Full Code Here


     * @param ssl A boolean value.
     * @throws ProcessingException when something went wrong.
     */
    protected void setSSLProtected(boolean ssl) throws ProcessingException {
        try {
            ModifiablePolicy policy = getPolicy();
            policy.setSSL(ssl);
            getPolicyManager().saveSubtreePolicy(getPolicyURL(), policy);
        } catch (AccessControlException e) {
            throw new ProcessingException("Resolving policy failed: ", e);
        }
    }
View Full Code Here

     * @throws ProcessingException when something went wrong.
     */
    protected void manipulateCredential(Accreditable accreditable, Role role, String operation,
            String method) throws ProcessingException {
        try {
            ModifiablePolicy policy = getPolicy();

            if (operation.equals(ADD)) {
                policy.addRole(accreditable, role, method);
            } else if (operation.equals(DELETE)) {
                policy.removeRole(accreditable, role);
            } else if (operation.equals(UP)) {
                policy.moveRoleUp(accreditable, role);
            } else if (operation.equals(DOWN)) {
                policy.moveRoleDown(accreditable, role);
            }
            getPolicyManager().saveSubtreePolicy(getPolicyURL(), policy);

        } catch (Exception e) {
            throw new ProcessingException("Manipulating credential failed: ", e);
View Full Code Here

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

        List credentials = new ArrayList();

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

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

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

TOP

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

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.