public String getPath() throws RepositoryException { return ((ItemBasedPrincipal) delegatee).getPath(); } }
public String getPath() throws RepositoryException { return ((ItemBasedPrincipal) delegatee).getPath(); } }
/** * * @param principal the principal * @return the path * @throws RepositoryException if an error occurs */ String getPathToAcNode(Principal principal) throws RepositoryException { StringBuffer princPath = new StringBuffer(acRootPath); if (principal instanceof ItemBasedPrincipal) { princPath.append(((ItemBasedPrincipal) principal).getPath()); } else { princPath.append("/"); princPath.append(Text.escapeIllegalJcrChars(principal.getName())); } return princPath.toString(); }
/** * * @param principal the principal * @return the path * @throws RepositoryException if an error occurs */ String getPathToAcNode(Principal principal) throws RepositoryException { StringBuffer princPath = new StringBuffer(acRootPath); if (principal instanceof ItemBasedPrincipal) { princPath.append(((ItemBasedPrincipal) principal).getPath()); } else { princPath.append("/"); princPath.append(Text.escapeIllegalJcrChars(principal.getName())); } return princPath.toString(); }
@NotNull @Override public JackrabbitAccessControlPolicy[] getPolicies(@NotNull Principal principal) throws RepositoryException { Util.checkValidPrincipal(principal, principalManager); String oakPath = (principal instanceof ItemBasedPrincipal) ? ((ItemBasedPrincipal) principal).getPath() : null; JackrabbitAccessControlPolicy policy = createPrincipalACL(oakPath, principal); if (policy != null) { return new JackrabbitAccessControlPolicy[]{policy}; } else { return new JackrabbitAccessControlPolicy[0]; } }
private NodeImpl getUserNode(ItemBasedPrincipal principal) { NodeImpl userNode = null; if (principal != null) { try { String path = principal.getPath(); userNode = (NodeImpl) session.getNode(path); } catch (RepositoryException e) { log.warn("Error while retrieving user node. {}", e.getMessage()); } } return userNode; }
@NotNull @Override public JackrabbitAccessControlPolicy[] getPolicies(@NotNull Principal principal) throws RepositoryException { Util.checkValidPrincipal(principal, principalManager); String oakPath = (principal instanceof ItemBasedPrincipal) ? ((ItemBasedPrincipal) principal).getPath() : null; JackrabbitAccessControlPolicy policy = createPrincipalACL(oakPath, principal); if (policy != null) { return new JackrabbitAccessControlPolicy[]{policy}; } else { return new JackrabbitAccessControlPolicy[0]; } }
@Nonnull @Override public JackrabbitAccessControlPolicy[] getPolicies(@Nonnull Principal principal) throws RepositoryException { Util.checkValidPrincipal(principal, principalManager); String oakPath = (principal instanceof ItemBasedPrincipal) ? ((ItemBasedPrincipal) principal).getPath() : null; JackrabbitAccessControlPolicy policy = createPrincipalACL(oakPath, principal); if (policy != null) { return new JackrabbitAccessControlPolicy[]{policy}; } else { return new JackrabbitAccessControlPolicy[0]; } }
private NodeImpl getUserNode(ItemBasedPrincipal principal) { NodeImpl userNode = null; if (principal != null) { try { String path = principal.getPath(); userNode = (NodeImpl) session.getNode(path); } catch (RepositoryException e) { log.warn("Error while retrieving user node. {}", e.getMessage()); } } return userNode; }
@NotNull @Override public JackrabbitAccessControlPolicy[] getApplicablePolicies(@NotNull Principal principal) throws RepositoryException { Util.checkValidPrincipal(principal, principalManager); String oakPath = (principal instanceof ItemBasedPrincipal) ? ((ItemBasedPrincipal) principal).getPath() : null; JackrabbitAccessControlPolicy policy = createPrincipalACL(oakPath, principal); if (policy != null) { return new JackrabbitAccessControlPolicy[0]; } else { return new JackrabbitAccessControlPolicy[]{new PrincipalACL(oakPath, principal)}; } }
@Nonnull @Override public JackrabbitAccessControlPolicy[] getApplicablePolicies(@Nonnull Principal principal) throws RepositoryException { Util.checkValidPrincipal(principal, principalManager); String oakPath = (principal instanceof ItemBasedPrincipal) ? ((ItemBasedPrincipal) principal).getPath() : null; JackrabbitAccessControlPolicy policy = createPrincipalACL(oakPath, principal); if (policy != null) { return new JackrabbitAccessControlPolicy[0]; } else { return new JackrabbitAccessControlPolicy[]{new PrincipalACL(oakPath, principal)}; } }
@NotNull @Override public JackrabbitAccessControlPolicy[] getApplicablePolicies(@NotNull Principal principal) throws RepositoryException { Util.checkValidPrincipal(principal, principalManager); String oakPath = (principal instanceof ItemBasedPrincipal) ? ((ItemBasedPrincipal) principal).getPath() : null; JackrabbitAccessControlPolicy policy = createPrincipalACL(oakPath, principal); if (policy != null) { return new JackrabbitAccessControlPolicy[0]; } else { return new JackrabbitAccessControlPolicy[]{new PrincipalACL(oakPath, principal)}; } }
@NotNull @Override public Set<Principal> getMembershipPrincipals(@NotNull Principal principal) { if (!GroupPrincipals.isGroup(principal)) { try { if (principal instanceof ItemBasedPrincipal) { Tree t = root.getTree(((ItemBasedPrincipal) principal).getPath()); return getGroupPrincipals(t); } else { return getGroupPrincipals(userManager.getAuthorizable(principal)); } } catch (RepositoryException e) { log.debug(e.getMessage()); } } return ImmutableSet.of(); }
String authPath = ((ItemBasedPrincipal) principal).getPath(); if (session.nodeExists(authPath)) { n = (NodeImpl) session.getNode(authPath);
String name = getName(); if (member instanceof ItemBasedPrincipal) { Tree tree = root.getTree(((ItemBasedPrincipal) member).getPath()); if (UserUtil.isType(tree, AuthorizableType.USER)) { PropertyState ps = tree.getProperty(REP_EXTERNAL_PRINCIPAL_NAMES);
Principal pr = user.getPrincipal(); if (pr instanceof ItemBasedPrincipal) { String userPath = ((ItemBasedPrincipal) pr).getPath(); NodeImpl userNode = (NodeImpl) session.getNode(userPath); if (userNode.hasNode(TOKENS_NODE_NAME)) {
@Override protected void setUp() throws Exception { super.setUp(); if (superuser instanceof JackrabbitSession) { UserManager umgr = ((JackrabbitSession) superuser).getUserManager(); String uid = "test"; while (umgr.getAuthorizable(uid) != null) { uid += "_"; } testuser = umgr.createUser(uid, uid); Principal p = testuser.getPrincipal(); if (p instanceof ItemBasedPrincipal) { testuserPath = ((ItemBasedPrincipal) p).getPath(); } else { throw new NotExecutableException(); } creds = new SimpleCredentials(uid, uid.toCharArray()); if (!umgr.isAutoSave()) { doSave = true; superuser.save(); } } else { throw new NotExecutableException(); } }
public void testSystemUsersAreSaved() throws Exception { String adminId = ((UserPerWorkspaceSecurityManager) secMgr).adminId; UserManager umgr = ((JackrabbitSession) superuser).getUserManager(); Principal p = umgr.getAuthorizable(adminId).getPrincipal(); if (p instanceof ItemBasedPrincipal) { Item item = superuser.getItem(((ItemBasedPrincipal) p).getPath()); assertFalse(item.isNew()); assertFalse(item.isModified()); } }
@Override protected void setUp() throws Exception { super.setUp(); if (superuser instanceof SessionImpl) { UserManager umgr = ((SessionImpl) superuser).getUserManager(); if (!umgr.isAutoSave()) { umgr.autoSave(true); } String uid = "test"; while (umgr.getAuthorizable(uid) != null) { uid += "_"; } testuser = umgr.createUser(uid, uid); userId = testuser.getID(); } else { throw new NotExecutableException(); } if (superuser.nodeExists(((ItemBasedPrincipal) testuser.getPrincipal()).getPath())) { session = (SessionImpl) superuser; } else { session = (SessionImpl) getHelper().getSuperuserSession("security"); } tokenProvider = new CompatTokenProvider((SessionImpl) session, TokenBasedAuthentication.TOKEN_EXPIRATION); }
@Override protected void setUp() throws Exception { super.setUp(); if (superuser instanceof SessionImpl) { UserManager umgr = ((SessionImpl) superuser).getUserManager(); if (!umgr.isAutoSave()) { umgr.autoSave(true); } String uid = "test"; while (umgr.getAuthorizable(uid) != null) { uid += "_"; } testuser = umgr.createUser(uid, uid); userId = testuser.getID(); } else { throw new NotExecutableException(); } if (superuser.nodeExists(((ItemBasedPrincipal) testuser.getPrincipal()).getPath())) { session = (SessionImpl) superuser; } else { session = (SessionImpl) getHelper().getSuperuserSession("security"); } tokenProvider = new TokenProvider((SessionImpl) session, TokenBasedAuthentication.TOKEN_EXPIRATION); }