/** * Always returns the name of the <code>SystemPrincipal</code>. * * @return the name of <code>SystemPrincipal</code>. */ @Override protected String retrieveUserId(Subject subject, String workspaceName) throws RepositoryException { return new SystemPrincipal().getName(); }
/** * @see AbstractAccessControlManager#getPrivilegeManager() */ @Override protected PrivilegeManager getPrivilegeManager() throws RepositoryException { checkInitialized(); return privilegeManager; }
/** * @see AccessManager#init(AMContext) */ public void init(AMContext amContext) throws AccessDeniedException, Exception { init(amContext, null, null); }
private void assignUserPrincipals(Set<Principal> principals, String userId) { if(userId == null) { principals.add(new AnonymousPrincipal()); } else { principals.add(new UserPrincipal(userId)); } }
/** * @see AccessManager#canAccess(String) */ public boolean canAccess(String workspaceName) throws RepositoryException { checkInitialized(); return wspAccess.canAccess(workspaceName); }
@Override public boolean isGranted(Path absPath, int permissions) throws RepositoryException { log.debug("isGranted({}:{}, {})", amctx.getWorkspaceName(), absPath, permissions); return super.isGranted(absPath, permissions); }
public void testIsGrantedPathToNonExistingItem() throws NotExecutableException, RepositoryException { AccessManager acMgr = getAccessManager(superuser); Path p = PathFactoryImpl.getInstance().getRootPath(); // existing node-path assertTrue(acMgr.isGranted(p, Permission.ALL)); // not existing property: assertTrue(acMgr.isGranted(p, NameConstants.JCR_CREATED, Permission.ALL)); // existing property assertTrue(acMgr.isGranted(p, NameConstants.JCR_PRIMARYTYPE, Permission.ALL)); }
/** */ public void testCheckPermissionWithNoPermissionFlag() throws RepositoryException, NotExecutableException { AccessManager acMgr = getAccessManager(superuser); NodeId id = (NodeId) getItemId(superuser.getItem(testRootNode.getPath())); // NOTE: backwards compatibility. // for deprecated method: invalid perm-flags will be ignored acMgr.checkPermission(id, AccessManager.READ - 1); }
public boolean isGranted(ItemId id, int permissions) throws ItemNotFoundException, RepositoryException { return super.isGranted(id, permissions); }
/** * {@inheritDoc} * @see org.apache.sling.jcr.jackrabbit.server.impl.security.TrustedCredentials#getPrincipal(java.lang.String) */ @Override protected Principal getPrincipal(String userId) { return new AnonymousPrincipal(); }
@Override public JackrabbitAccessControlPolicy[] getPolicies(Principal principal) throws AccessDeniedException, AccessControlException, UnsupportedRepositoryOperationException, RepositoryException { log.debug("getPolicies({})", principal); return super.getPolicies(principal); }
protected Principal getTestPrincipal(String name) throws RepositoryException { return new TestPrincipal(name); }
/** * Always returns the name of the <code>SystemPrincipal</code>. * * @return the name of <code>SystemPrincipal</code>. */ @Override protected String retrieveUserId(Subject subject, String workspaceName) throws RepositoryException { return new SystemPrincipal().getName(); }
/** * @see AccessManager#canAccess(String) */ public boolean canAccess(String workspaceName) throws RepositoryException { checkInitialized(); return wspAccess.canAccess(workspaceName); }
public void testCheckPermissionWithInvalidPermission() throws RepositoryException, NotExecutableException { AccessManager acMgr = getAccessManager(superuser); NodeId id = (NodeId) getItemId(superuser.getItem(testRootNode.getPath())); // NOTE: backwards compatibility. // for deprecated method: invalid perm-flags will be ignored acMgr.checkPermission(id, AccessManager.READ | AccessManager.WRITE | AccessManager.REMOVE + 1); }
/** * @see AccessManager#init(AMContext) */ public void init(AMContext amContext) throws AccessDeniedException, Exception { init(amContext, null, null); }
public boolean isGranted(Path parentPath, Name childName, int permissions) throws RepositoryException { return super.isGranted(parentPath, childName, permissions); }
/** * @see AbstractAccessControlManager#getPrivilegeManager() */ @Override protected PrivilegeManager getPrivilegeManager() throws RepositoryException { checkInitialized(); return privilegeManager; }
@Override public void init(AMContext amContext, AccessControlProvider acProvider, WorkspaceAccessManager wspAccessManager) throws AccessDeniedException, Exception { log.debug("{}:init({}, {}, {})", this, amContext, acProvider, wspAccessManager); super.init(amContext, acProvider, wspAccessManager); this.amctx = amContext; }
@Override public boolean isGranted(ItemId id, int actions) throws ItemNotFoundException, RepositoryException { log.debug("isGranted({}, {})", id, actions); return super.isGranted(id, actions); }