RepositoryPublishService { protected void validateAccess() throws PentahoAccessControlException { if ( !getPolicy().isAllowed( PublishAction.NAME ) ) { throw new PentahoAccessControlException( "Access Denied" ); } }  @Deprecated void writeFile( String pathId, InputStream fileContents, Boolean overwriteFile ); @Deprecated void publishFile( String pathId, InputStream fileContents, Boolean overwriteFile ); void publishFile( String pathId, InputStream fileContents, Optional<Properties> fileProperties );  }
@Test( expected = PentahoAccessControlException.class ) public void prohibitedForAdministerSecurity() throws PentahoAccessControlException { IAuthorizationPolicy policy = mock( IAuthorizationPolicy.class ); when( policy.isAllowed( RepositoryReadAction.NAME ) ).thenReturn( true ); when( policy.isAllowed( RepositoryCreateAction.NAME ) ).thenReturn( true ); when( policy.isAllowed( AdministerSecurityAction.NAME ) ).thenReturn( true ); when( policy.isAllowed( PublishAction.NAME ) ).thenReturn( false ); repositoryPublishService.validateAccess(); }