Package org.apache.lenya.ac

Examples of org.apache.lenya.ac.Accreditable


            throws ProcessingException {

        try {
            DefaultPolicy policy = getPolicyManager().buildSubtreePolicy(getAccreditableManager(),
                    getPolicyURL());
            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


                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

     * @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 (this.removedAccreditable instanceof User
            && elementName.equals(USER_ELEMENT)
            && ((User) this.removedAccreditable).getId().equals(id)) {
            accreditable = this.removedAccreditable;
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

                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

                String type = types[i];
                String paramName = operations[j] + "Credential_" + type;
                if (getParameterAsString(paramName) != null) {
                    String roleId = getParameterAsString(ROLE);
                    String id = getParameterAsString(type);
                    Accreditable item = getAccreditable(type, id);
                    if (item == null) {
                        addErrorMessage("no_such_accreditable", new String[] { type, id });
                    } else {
                        Role role = getRoleManager().getRole(roleId);
                        if (role == null) {
View Full Code Here

                String paramName = operations[j] + "Credential_" + type;
                if (getParameterAsString(paramName) != null) {
                    String roleId = getParameterAsString(ROLE);
                    String method = getParameterAsString(METHOD);
                    String id = getParameterAsString(type);
                    Accreditable item = getAccreditable(type, id);
                    Role role = getRoleManager().getRole(roleId);
                    manipulateCredential(item, role, operations[j], method);
                    setParameter(SUB_CREDENTIALS, getSubtreeCredentials());
                    deleteParameter(paramName);
                }
View Full Code Here

            }
        }
    }

    protected Accreditable getAccreditable(String type, String id) {
        Accreditable item = null;
        if (type.equals(USER)) {
            item = getUserManager().getUser(id);
        } else if (type.equals(GROUP)) {
            item = getGroupManager().getGroup(id);
        } else if (type.equals(IPRANGE)) {
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.