Examples of AccessControlEntryImpl


Examples of org.apache.jackrabbit.core.security.authorization.AccessControlEntryImpl

           
            // in addition: trivial check if read access is denied somewhere
            canReadAll = canRead(session.getQPath("/"));           
            if (canReadAll) {
                for (AccessControlEntry entry : entries) {
                    AccessControlEntryImpl ace = (AccessControlEntryImpl) entry;
                    if (!ace.isAllow() && ace.getPrivilegeBits().includesRead()) {
                        // found an ace that defines read deny for a sub tree
                        // -> canReadAll is false.
                        canReadAll = false;
                        break;
                    }
View Full Code Here

Examples of org.apache.jackrabbit.core.security.authorization.AccessControlEntryImpl

            aclNode = (nodePath == null) ? createRepoAclNode() : createAclNode(nodePath);
        }
       
        AccessControlEntry[] entries = ((ACLTemplate) policy).getAccessControlEntries();
        for (AccessControlEntry entry : entries) {
            AccessControlEntryImpl ace = (AccessControlEntryImpl) entry;

            Name nodeName = getUniqueNodeName(aclNode, ace.isAllow() ? "allow" : "deny");
            Name ntName = (ace.isAllow()) ? NT_REP_GRANT_ACE : NT_REP_DENY_ACE;
            ValueFactory vf = session.getValueFactory();

            // create the ACE node
            NodeImpl aceNode = addNode(aclNode, nodeName, ntName);

            // write the rep:principalName property
            String principalName = ace.getPrincipal().getName();
            setProperty(aceNode, P_PRINCIPAL_NAME, vf.createValue(principalName));

            // ... and the rep:privileges property
            Privilege[] pvlgs = ace.getPrivileges();
            Value[] names = getPrivilegeNames(pvlgs, vf);
            setProperty(aceNode, P_PRIVILEGES, names);

            // store the restrictions:
            Set<Name> restrNames = ace.getRestrictions().keySet();
            for (Name restrName : restrNames) {
                Value value = ace.getRestriction(restrName);
                setProperty(aceNode, restrName, value);
            }
        }

        // mark the parent modified.
View Full Code Here

Examples of org.apache.jackrabbit.core.security.authorization.AccessControlEntryImpl

        }

        /* add all new entries defined on the template */
        AccessControlEntry[] aces = acl.getAccessControlEntries();
        for (AccessControlEntry ace1 : aces) {
            AccessControlEntryImpl ace = (AccessControlEntryImpl) ace1;

            // create the ACE node
            Name nodeName = getUniqueNodeName(aclNode, "entry");
            Name ntName = (ace.isAllow()) ? NT_REP_GRANT_ACE : NT_REP_DENY_ACE;
            NodeImpl aceNode = addNode(aclNode, nodeName, ntName);

            ValueFactory vf = session.getValueFactory();
            // write the rep:principalName property
            setProperty(aceNode, P_PRINCIPAL_NAME, vf.createValue(ace.getPrincipal().getName()));
            // ... and the rep:privileges property
            Privilege[] privs = ace.getPrivileges();
            Value[] vs = new Value[privs.length];
            for (int j = 0; j < privs.length; j++) {
                vs[j] = vf.createValue(privs[j].getName(), PropertyType.NAME);
            }
            setProperty(aceNode, P_PRIVILEGES, vs);

            // store the restrictions:
            Set<Name> restrNames = ace.getRestrictions().keySet();
            for (Name restrName : restrNames) {
                Value value = ace.getRestriction(restrName);
                setProperty(aceNode, restrName, value);
            }
        }

        // mark the parent modified.
View Full Code Here

Examples of org.apache.jackrabbit.core.security.authorization.AccessControlEntryImpl

            aclNode = (nodePath == null) ? createRepoAclNode() : createAclNode(nodePath);
        }
       
        AccessControlEntry[] entries = ((ACLTemplate) policy).getAccessControlEntries();
        for (AccessControlEntry entry : entries) {
            AccessControlEntryImpl ace = (AccessControlEntryImpl) entry;

            Name nodeName = getUniqueNodeName(aclNode, ace.isAllow() ? "allow" : "deny");
            Name ntName = (ace.isAllow()) ? NT_REP_GRANT_ACE : NT_REP_DENY_ACE;
            ValueFactory vf = session.getValueFactory();

            // create the ACE node
            NodeImpl aceNode = addNode(aclNode, nodeName, ntName);

            // write the rep:principalName property
            String principalName = ace.getPrincipal().getName();
            setProperty(aceNode, P_PRINCIPAL_NAME, vf.createValue(principalName));

            // ... and the rep:privileges property
            Privilege[] pvlgs = ace.getPrivileges();
            Value[] names = getPrivilegeNames(pvlgs, vf);
            setProperty(aceNode, P_PRIVILEGES, names);

            // store the restrictions:
            Set<Name> restrNames = ace.getRestrictions().keySet();
            for (Name restrName : restrNames) {
                Value value = ace.getRestriction(restrName);
                setProperty(aceNode, restrName, value);
            }
        }

        // mark the parent modified.
View Full Code Here

Examples of org.apache.jackrabbit.core.security.authorization.AccessControlEntryImpl

           
            // in addition: trivial check if read access is denied somewhere
            canReadAll = canRead(session.getQPath("/"));           
            if (canReadAll) {
                for (AccessControlEntry entry : entries) {
                    AccessControlEntryImpl ace = (AccessControlEntryImpl) entry;
                    if (!ace.isAllow() && ace.getPrivilegeBits().includesRead()) {
                        // found an ace that defines read deny for a sub tree
                        // -> canReadAll is false.
                        canReadAll = false;
                        break;
                    }
View Full Code Here

Examples of org.apache.jackrabbit.core.security.authorization.AccessControlEntryImpl

            // in addition: trivial check if read access is deny somewhere
            // as as shortcut in #canRead(Path)
            canReadAll = canRead(session.getQPath("/"));           
            if (canReadAll) {
                for (AccessControlEntry entry : entries) {
                    AccessControlEntryImpl ace = (AccessControlEntryImpl) entry;
                    if (!ace.isAllow() && ((ace.getPrivilegeBits() & readBits) == readBits)) {
                        // found an ace that defines read deny for a sub tree
                        // -> canReadAll is false.
                        canReadAll = false;
                        break;
                    }
View Full Code Here

Examples of org.apache.jackrabbit.core.security.authorization.AccessControlEntryImpl

            aclNode = createAclNode(nodePath);
        }
       
        AccessControlEntry[] entries = ((ACLTemplate) policy).getAccessControlEntries();
        for (AccessControlEntry entry : entries) {
            AccessControlEntryImpl ace = (AccessControlEntryImpl) entry;

            Name nodeName = getUniqueNodeName(aclNode, ace.isAllow() ? "allow" : "deny");
            Name ntName = (ace.isAllow()) ? NT_REP_GRANT_ACE : NT_REP_DENY_ACE;
            ValueFactory vf = session.getValueFactory();

            // create the ACE node
            NodeImpl aceNode = addNode(aclNode, nodeName, ntName);

            // write the rep:principalName property
            String principalName = ace.getPrincipal().getName();
            setProperty(aceNode, P_PRINCIPAL_NAME, vf.createValue(principalName));

            // ... and the rep:privileges property
            Privilege[] pvlgs = ace.getPrivileges();
            Value[] names = getPrivilegeNames(pvlgs, vf);
            setProperty(aceNode, P_PRIVILEGES, names);

            // store the restrictions:
            Set<Name> restrNames = ace.getRestrictions().keySet();
            for (Name restrName : restrNames) {
                Value value = ace.getRestriction(restrName);
                setProperty(aceNode, restrName, value);
            }
        }

        // mark the parent modified.
View Full Code Here

Examples of org.springframework.security.acls.domain.AccessControlEntryImpl

                }

                public void setValues(PreparedStatement stmt, int i) throws SQLException {
                    AccessControlEntry entry_ = acl.getEntries().get(i);
                    Assert.isTrue(entry_ instanceof AccessControlEntryImpl, "Unknown ACE class");
                    AccessControlEntryImpl entry = (AccessControlEntryImpl) entry_;

                    stmt.setLong(1, ((Long) acl.getId()).longValue());
                    stmt.setInt(2, i);
                    stmt.setLong(3, createOrRetrieveSidPrimaryKey(entry.getSid(), true).longValue());
                    stmt.setInt(4, entry.getPermission().getMask());
                    stmt.setBoolean(5, entry.isGranting());
                    stmt.setBoolean(6, entry.isAuditSuccess());
                    stmt.setBoolean(7, entry.isAuditFailure());
                }
            });
    }
View Full Code Here

Examples of org.springframework.security.acls.domain.AccessControlEntryImpl

                Permission permission = permissionFactory.buildFromMask(mask);
                boolean granting = rs.getBoolean("granting");
                boolean auditSuccess = rs.getBoolean("audit_success");
                boolean auditFailure = rs.getBoolean("audit_failure");

                AccessControlEntryImpl ace = new AccessControlEntryImpl(aceId, acl, recipient, permission, granting,
                        auditSuccess, auditFailure);

                //Field acesField = FieldUtils.getField(AclImpl.class, "aces");
                List<AccessControlEntryImpl> aces = readAces((AclImpl)acl);
View Full Code Here

Examples of org.springframework.security.acls.domain.AccessControlEntryImpl

                }

                public void setValues(PreparedStatement stmt, int i) throws SQLException {
                    AccessControlEntry entry_ = acl.getEntries().get(i);
                    Assert.isTrue(entry_ instanceof AccessControlEntryImpl, "Unknown ACE class");
                    AccessControlEntryImpl entry = (AccessControlEntryImpl) entry_;

                    stmt.setLong(1, ((Long) acl.getId()).longValue());
                    stmt.setInt(2, i);
                    stmt.setLong(3, createOrRetrieveSidPrimaryKey(entry.getSid(), true).longValue());
                    stmt.setInt(4, entry.getPermission().getMask());
                    stmt.setBoolean(5, entry.isGranting());
                    stmt.setBoolean(6, entry.isAuditSuccess());
                    stmt.setBoolean(7, entry.isAuditFailure());
                }
            });
    }
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.