@Override public boolean hasAccess( ObjectId id, RepositoryFilePermission perm ) throws KettleException { RepositoryFile repositoryFile = pur.getFileById( id.getId() ); return pur.hasAccess( repositoryFile.getPath(), EnumSet.of( perm ) ); }
public Boolean call() throws Exception { return delegatee.hasAccess( path, permissions ); } }, Messages.getInstance().getString( "ExceptionLoggingDecorator.hasAccess", path ) ); //$NON-NLS-1$
private boolean isPermitted( final String path ) { try { return getRepository().hasAccess( path, EnumSet.copyOf( permissions ) ); } catch ( Exception e ) { logger.warn( e.getMessage(), e ); } return false; } }
/** * Returns {@code true} if user has all permissions given. Note that {@code false} is returned when the path does * not exist. * * @param path * path to file or folder * @param permissions * permissions to check * @return {@code true} if user has all permissions given */ @Override public boolean hasAccess( final String path, final EnumSet<RepositoryFilePermission> permissions ) { return repository.hasAccess( path, permissions ); }
public boolean hasAccess( String path, List<Integer> permissions ) { return repo.hasAccess( path, RepositoryFileAclAceAdapter.toPerms( permissions ) ); }
@Override public boolean canAccess( final RepositoryFile repositoryFile, final EnumSet<RepositoryFilePermission> permissions ) { if ( repositoryFile == null ) { return false; } // Obtain a reference to ACL node as "system", guaranteed access final RepositoryFile aclNode = getAclNode( repositoryFile ); // If no ACL node is present, it's a public resource // Removed redundant call to getAclNode via BISERVER-12780 if ( aclNode == null ) { return true; } boolean notFound; try { // Check to see if user has READ access to file, this will return null if not. notFound = ( unifiedRepository.getFileById( aclNode.getId() ) == null ); } catch ( Exception e ) { if ( logger.isWarnEnabled() ) { logger.warn( "Error checking access for file", e ); } notFound = true; } if ( notFound ) { return false; } // if read passed, check the other permissions return unifiedRepository.hasAccess( aclNode.getPath(), permissions ); }