@Test public void testUser() { HttpServletRequest req; Assert.assertTrue(plugin.isAllowed(req = createRequest("007"), new Group())); Assert.assertEquals("007", ((User) req.getAttribute(UserPlugin.REQUEST_ATTR)).getUsername()); Assert.assertTrue(plugin.isAllowed(req = createRequest("008"), new Project())); Assert.assertEquals("008", ((User) req.getAttribute(UserPlugin.REQUEST_ATTR)).getUsername()); Assert.assertTrue(plugin.isAllowed(req = createRequest("009"), createGroup("some group"))); Assert.assertEquals("009", ((User) req.getAttribute(UserPlugin.REQUEST_ATTR)).getUsername()); Assert.assertTrue(plugin.isAllowed(req = createRequest("00A"), createProject("some project"))); Assert.assertEquals("00A", ((User) req.getAttribute(UserPlugin.REQUEST_ATTR)).getUsername()); }
@Override public boolean isAllowed(HttpServletRequest request, Project project) { return getUser(request) != null; }
UserPlugin implements IAuthorizationPlugin { @Override public boolean isAllowed(HttpServletRequest request, Project project) { return getUser(request) != null; } }
UserPlugin implements IAuthorizationPlugin { @Override public boolean isAllowed(HttpServletRequest request, Project project) { return getUser(request) != null; } UserPlugin(); protected  UserPlugin(IUserDecoder decoder); }
UserPlugin implements IAuthorizationPlugin { @Override public boolean isAllowed(HttpServletRequest request, Project project) { return getUser(request) != null; } UserPlugin(); protected  UserPlugin(IUserDecoder decoder); @Override void load(Map<String, Object> parameters); @Override void unload(); @Override boolean isAllowed(HttpServletRequest request, Project project); @Override boolean isAllowed(HttpServletRequest request, Group group); }
UserPlugin implements IAuthorizationPlugin { @Override public boolean isAllowed(HttpServletRequest request, Project project) { return getUser(request) != null; } UserPlugin(); protected  UserPlugin(IUserDecoder decoder); @Override void load(Map<String, Object> parameters); @Override void unload(); @Override boolean isAllowed(HttpServletRequest request, Project project); @Override boolean isAllowed(HttpServletRequest request, Group group); static final String REQUEST_ATTR; }