Package org.apache.lenya.ac

Examples of org.apache.lenya.ac.Accreditable


        throws ProcessingException {

        try {
            DefaultPolicy policy =
                policyManager.buildSubtreePolicy(accessController.getAccreditableManager(), url);
            Accreditable accreditable = (Accreditable) item;

            if (operation.equals(ADD)) {
                policy.addRole(accreditable, role);
            } else if (operation.equals(DELETE)) {
                policy.removeRole(accreditable, role);
View Full Code Here


     * @see org.apache.lenya.ac.impl.PolicyBuilder#getAccreditable(java.lang.String, java.lang.String)
     */
    protected Accreditable getAccreditable(String elementName, String id)
        throws AccessControlException {

        Accreditable accreditable;

        if (removedAccreditable instanceof User
            && elementName.equals(USER_ELEMENT)
            && ((User) removedAccreditable).getId().equals(id)) {
            accreditable = removedAccreditable;
View Full Code Here

                policyCredentials.add(creds[j]);
            }
        }
        for (Iterator i = policyCredentials.iterator(); i.hasNext();) {
            Credential credential = (Credential) i.next();
            Accreditable accreditable = credential.getAccreditable();
            Role[] roles = credential.getRoles();
            for (int j = 0; j < roles.length; j++) {
                credentials.add(new CredentialWrapper(accreditable, roles[j]));
            }
        }
View Full Code Here

                document);

        Element[] credentialElements = helper.getChildren(policyElement);

        for (int i = 0; i < credentialElements.length; i++) {
            Accreditable accreditable = null;

            String id = credentialElements[i].getAttribute(ID_ATTRIBUTE);
            accreditable = getAccreditable(credentialElements[i].getLocalName(), id);

            Credential credential = new Credential(accreditable);
View Full Code Here

     */
    protected Accreditable getAccreditable(
        String elementName,
        String id)
        throws AccessControlException {
        Accreditable accreditable = null;

        if (elementName.equals(USER_ELEMENT)) {
            accreditable = getAccreditableManager().getUserManager().getUser(id);
        } else if (elementName.equals(GROUP_ELEMENT)) {
            accreditable = getAccreditableManager().getGroupManager().getGroup(id);
View Full Code Here

        Credential[] credentials = policy.getCredentials();
        Element policyElement = helper.getDocument().getDocumentElement();

        for (int i = 0; i < credentials.length; i++) {
            Accreditable accreditable = credentials[i].getAccreditable();
            Element accreditableElement = save(accreditable, helper);
           
            Role[] roles = credentials[i].getRoles();
            for (int j = 0; j < roles.length; j++) {
                Element roleElement = helper.createElement(ROLE_ELEMENT);
View Full Code Here

        Set roles = new HashSet();

        for (int credIndex = 0; credIndex < credentials.length; credIndex++) {
            for (int accrIndex = 0; accrIndex < accreditables.length; accrIndex++) {
                Credential credential = credentials[credIndex];
                Accreditable accreditable = accreditables[accrIndex];

                if (credential.getAccreditable().equals(accreditable)) {
                    roles.addAll(Arrays.asList(credential.getRoles()));
                }
            }
View Full Code Here

        Credential[] credentials = getCredentials();
        Set returnCredential = new LinkedHashSet();
        for (int credIndex = 0; credIndex < credentials.length; credIndex++) {
            Credential credential = credentials[credIndex];
            for (int accrIndex = 0; accrIndex < accreditables.length; accrIndex++) {
                Accreditable accreditable = accreditables[accrIndex];
                if (credential.getAccreditable().equals(accreditable)) {
                    returnCredential.add(credential);
                }
            }
        }
View Full Code Here

        for (int credIndex = 0; credIndex < credentials.length; credIndex++) {
            Credential credential = credentials[credIndex];
           
            for (int accrIndex = 0; accrIndex < accreditables.length; accrIndex++) {
                Accreditable accreditable = accreditables[accrIndex];

                if (credential.getAccreditable().equals(accreditable)) {
                    returnCredential.add(credential);
                }
            }
View Full Code Here

        Set roles = new HashSet();

        for (int credIndex = 0; credIndex < credentials.length; credIndex++) {
            for (int accrIndex = 0; accrIndex < accreditables.length; accrIndex++) {
                Credential credential = credentials[credIndex];
                Accreditable accreditable = accreditables[accrIndex];

                if (credential.getAccreditable().equals(accreditable)) {
                    roles.addAll(Arrays.asList(credential.getRoles()));
                }
            }
View Full Code Here

TOP

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

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.