use of org.opengrok.indexer.authorization.IAuthorizationPlugin in project OpenGrok by OpenGrok.
the class ProjectHelperTestBase method setUp.
@BeforeEach
public void setUp() {
assertEquals(4, env.getGroups().size(), "Should contain 4 groups");
assertEquals(40, env.getProjects().size(), "Should contain 40 project");
assertEquals(20, env.getRepositories().size(), "Should contain 20 repositories");
assertNotNull(env.getProjectRepositoriesMap(), "Repository map should not be null");
assertEquals(20, env.getProjectRepositoriesMap().size(), "Repository map should contain 20 project");
env.setAuthorizationFramework(new AuthorizationFramework());
env.getAuthorizationFramework().reload();
IAuthorizationPlugin plugin = new TestPlugin() {
@Override
public boolean isAllowed(HttpServletRequest request, Project project) {
return project.getName().startsWith("allowed");
}
@Override
public boolean isAllowed(HttpServletRequest request, Group group) {
return group.getName().startsWith("allowed");
}
};
invokeAddPlugin(plugin);
cfg = PageConfig.get(getRequest());
helper = cfg.getProjectHelper();
}
Aggregations