use of org.opensolaris.opengrok.authorization.IAuthorizationPlugin in project OpenGrok by OpenGrok.
the class ProjectHelperTestBase method setUp.
@Before
public void setUp() {
Assert.assertEquals("Should contain 4 groups", 4, env.getGroups().size());
Assert.assertEquals("Should contain 40 project", 40, env.getProjects().size());
Assert.assertEquals("Should contain 20 repositories", 20, env.getRepositories().size());
Assert.assertNotNull("Repository map should not be null", env.getProjectRepositoriesMap());
Assert.assertEquals("Repository map should contain 20 project", 20, env.getProjectRepositoriesMap().size());
invokeRemoveAll();
instance = getInstance();
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