mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-17 02:31:14 +01:00
User resource: No longer check for admin role.
In SCMM v2 we use permissions. The checks are already implemented in DefaultUserManager called by the resource. When not authorized, the check results in an AuthorizationException, which is mapped to 403. As this is no longer realized in the resource, the corresponding test is removed.
This commit is contained in:
@@ -93,7 +93,6 @@ public class UserRootResourceTest {
|
||||
dispatcher.invoke(request, response);
|
||||
|
||||
assertEquals(HttpServletResponse.SC_OK, response.getStatus());
|
||||
System.out.println(response.getContentAsString());
|
||||
assertTrue(response.getContentAsString().contains("\"name\":\"Neo\""));
|
||||
assertTrue(response.getContentAsString().contains("\"password\":\"__dummypassword__\""));
|
||||
assertTrue(response.getContentAsString().contains("\"self\":{\"href\":\"/v2/users/Neo\"}"));
|
||||
@@ -115,17 +114,6 @@ public class UserRootResourceTest {
|
||||
assertFalse(response.getContentAsString().contains("\"delete\":{\"href\":\"/v2/users/Neo\"}"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@SubjectAware(username = "unpriv")
|
||||
public void shouldNotGetSingleUserForSimpleUser() throws URISyntaxException {
|
||||
MockHttpRequest request = MockHttpRequest.get("/" + UserRootResource.USERS_PATH_V2 + "Neo");
|
||||
MockHttpResponse response = new MockHttpResponse();
|
||||
|
||||
dispatcher.invoke(request, response);
|
||||
|
||||
assertEquals(HttpServletResponse.SC_FORBIDDEN, response.getStatus());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldCreateNewUserWithEncryptedPassword() throws URISyntaxException, IOException {
|
||||
URL url = Resources.getResource("sonia/scm/api/v2/user-test-create.json");
|
||||
|
||||
Reference in New Issue
Block a user