Package org.apache.jackrabbit.api.security

Examples of org.apache.jackrabbit.api.security.JackrabbitAccessControlList.addEntry()


        Privilege[] ps = new Privilege[privs.length];
        for (int i=0; i<privs.length; i++) {
            ps[i] = admin.getAccessControlManager().privilegeFromName(privs[i]);
        }
        acl.addEntry(new PrincipalImpl(principal), ps, allow);
        admin.getAccessControlManager().setPolicy(path, acl);
        admin.save();
    }
}
View Full Code Here


                        } else {
                            svRestrictions.put(restName, values[0]);
                        }
                    }
                }
                acl.addEntry(principal, privileges, ace.allow, svRestrictions, mvRestrictions);
            }
        }
        acMgr.setPolicy(accessControlledPath, acl);
    }
View Full Code Here

                        }
                    }
                    if (!restrictions.isEmpty()) {
                        throw new ConstraintViolationException("ACE childInfo contained restrictions that could not be applied.");
                    }
                    acl.addEntry(principal, privileges, isAllow, restr);
                    acMgr.setPolicy(acl.getPath(), acl);
                    return;
                }
            }
        } else {
View Full Code Here

                }
            }
            if (!restrictions.isEmpty()) {
                throw new ConstraintViolationException("ACE childInfo contained restrictions that could not be applied.");
            }
            acl.addEntry(principal, privileges, isAllow, restr);
            return;
        }


        // could not apply the ACE. No suitable ACL found.
View Full Code Here

                        }
                    }
                    if (!restrictions.isEmpty()) {
                        throw new ConstraintViolationException("ACE childInfo contained restrictions that could not be applied.");
                    }
                    acl.addEntry(principal, privileges, isAllow, restr);
                    acMgr.setPolicy(acl.getPath(), acl);
                    return;
                }
            }
        } else {
View Full Code Here

                }
            }
            if (!restrictions.isEmpty()) {
                throw new ConstraintViolationException("ACE childInfo contained restrictions that could not be applied.");
            }
            acl.addEntry(principal, privileges, isAllow, restr);
            return;
        }


        // could not apply the ACE. No suitable ACL found.
View Full Code Here

                }
            }
        }

        if (acl != null) {
            acl.addEntry(principal, new Privilege[] {acMgr.privilegeFromName(Privilege.JCR_READ)}, allowRead);
            acMgr.setPolicy(n.getPath(), acl);
            s.save();
        } else {
            // no JackrabbitAccessControlList found.
            throw new NotExecutableException();
View Full Code Here

                }
            }
        }

        if (acl != null) {
            acl.addEntry(principal, new Privilege[] {acMgr.privilegeFromName(Privilege.JCR_READ)}, allowRead);
            acMgr.setPolicy(n.getPath(), acl);
            s.save();
        } else {
            // no JackrabbitAccessControlList found.
            throw new NotExecutableException();
View Full Code Here

                                                       boolean nodeBased) throws NotExecutableException, RepositoryException {
        if (nodeBased) {
            return givePrivileges(nPath, principal, privileges, getRestrictions(superuser, nPath));
        } else {
            JackrabbitAccessControlList tmpl = getPrincipalBasedPolicy(acMgr, nPath, principal);
            tmpl.addEntry(principal, privileges, true, restrictions);
            acMgr.setPolicy(tmpl.getPath(), tmpl);
            superuser.save();
            return tmpl;
        }
    }
View Full Code Here

                                                       boolean nodeBased) throws NotExecutableException, RepositoryException {
        if (nodeBased) {
            return withdrawPrivileges(nPath, principal, privileges, getRestrictions(superuser, nPath));
        } else {
            JackrabbitAccessControlList tmpl = getPrincipalBasedPolicy(acMgr, nPath, principal);
            tmpl.addEntry(principal, privileges, false, restrictions);
            acMgr.setPolicy(tmpl.getPath(), tmpl);
            superuser.save();
            return tmpl;
        }
    }
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.