private void checkAccessToRepository( String repositoryId ) throws NoSuchRepositoryAccessException { if ( !this.nexusItemAuthorizer.isViewable( NexusItemAuthorizer.VIEW_REPOSITORY_KEY, repositoryId ) ) { throw new NoSuchRepositoryAccessException( repositoryId ); } }
public void decide( Repository repository, ResourceStoreRequest request, Action action ) throws AccessDeniedException { //only bother checking item authorizer if there is no flag in request stating authorization //has been taken care of if ( !request.getRequestContext().containsKey( AccessManager.REQUEST_AUTHORIZED ) && !nexusItemAuthorizer.authorizePath( repository, request, action ) ) { // deny the access throw new AccessDeniedException( "Access denied on repository ID='" + repository.getId() + "', path='" + request.getRequestPath() + "', action='" + action + "'!" ); } } }
matched.addTargetSet( this.itemAuthorizer.getGroupsTargetSet( route.getTargetedRepository(), request ) ); return this.itemAuthorizer.authorizePath( matched, action );
return this.nexusItemAuthorizer.authorizePath(mr, req, Action.read);
private boolean filterEvent(NexusArtifactEvent event) { try { Repository repo = this.repositoryRegistry.getRepository(event.getNexusItemInfo().getRepositoryId()); ResourceStoreRequest req = new ResourceStoreRequest(event.getNexusItemInfo().getPath()); if (!this.nexusItemAuthorizer.authorizePath(repo, req, Action.read)) { return false; } } catch (NoSuchRepositoryException e) { // Can't get repository for artifact, therefore we can't authorize access, therefore you don't see it log.debug( "Feed entry contained invalid repository id " + event.getNexusItemInfo().getRepositoryId(), e); return false; } return true; }
private List<Repository> filterRepositoriesList(List<Repository> repositories) { // guard against npe if (repositories == null) { return null; } List<Repository> filteredRepositories = new ArrayList<Repository>(); for (Repository repository : repositories) { if (this.nexusItemAuthorizer.isViewable(NexusItemAuthorizer.VIEW_REPOSITORY_KEY, repository.getId())) { filteredRepositories.add(repository); } } return filteredRepositories; }
return this.nexusItemAuthorizer.authorizePath( mr, req, Action.read );
private void checkAccessToRepository(String repositoryId) throws NoSuchRepositoryAccessException { if (!this.nexusItemAuthorizer.isViewable(NexusItemAuthorizer.VIEW_REPOSITORY_KEY, repositoryId)) { throw new NoSuchRepositoryAccessException(repositoryId); } }
private List<Repository> filterRepositoriesList( List<Repository> repositories ) { // guard against npe if ( repositories == null ) { return null; } List<Repository> filteredRepositories = new ArrayList<Repository>(); for ( Repository repository : repositories ) { if ( this.nexusItemAuthorizer.isViewable( NexusItemAuthorizer.VIEW_REPOSITORY_KEY, repository.getId() ) ) { filteredRepositories.add( repository ); } } return filteredRepositories; }
private List<Repository> filterAccessToRepositories( Collection<? extends Repository> repositories ) { if ( repositories == null ) { return null; } List<Repository> filteredRepositories = new ArrayList<Repository>(); for ( Repository repository : repositories ) { if ( this.itemAuthorizer.isViewable( NexusItemAuthorizer.VIEW_REPOSITORY_KEY, repository.getId() ) ) { filteredRepositories.add( repository ); } } return filteredRepositories; }