use of io.lumeer.api.dto.JsonOrganization in project engine by Lumeer.
the class OrganizationServicePermissionsIT method testRemoveGroupPermissionManageRole.
@Test
public void testRemoveGroupPermissionManageRole() {
String name = "testRemoveGroupPermissionNoRole";
String code = "testRemoveGroupPermissionNoRole_code";
Organization organization = new JsonOrganization(code, name, "a", "b", null, null);
organizationFacade.createOrganization(organization);
organizationFacade.updateUserPermissions(code, new JsonPermission(userEmail, Role.toStringRoles(new HashSet<>(Arrays.asList(Role.READ, Role.MANAGE)))));
String group = "testGroup3";
Response response = client.target(TARGET_URI).path(PATH_PREFIX + code + "/permissions/groups/" + group).request(MediaType.APPLICATION_JSON).buildDelete().invoke();
assertThat(response.getStatusInfo()).isEqualTo(Response.Status.OK);
}
use of io.lumeer.api.dto.JsonOrganization in project engine by Lumeer.
the class OrganizationServicePermissionsIT method testCreateProjectInOrganizationManageRole.
@Test
public void testCreateProjectInOrganizationManageRole() {
String name = "testCreateProjectInOrganizationManageRole";
String code = "testCreateProjectInOrganizationManageRole_code";
Organization organization = new JsonOrganization(code, name, "a", "b", null, null);
organizationFacade.createOrganization(organization);
String projectCode = "proj2";
String projectName = "proj2_code";
Project project = new JsonProject(projectCode, projectName, "a", "b", null, null);
Response response = client.target(TARGET_URI).path(PATH_PREFIX + code + "/projects").request(MediaType.APPLICATION_JSON).buildPost(Entity.json(project)).invoke();
assertThat(response.getStatusInfo()).isEqualTo(Response.Status.OK);
}
use of io.lumeer.api.dto.JsonOrganization in project engine by Lumeer.
the class OrganizationServicePermissionsIT method testRemoveGroupPermissionNoRole.
@Test
public void testRemoveGroupPermissionNoRole() {
String name = "testRemoveGroupPermissionNoRole";
String code = "testRemoveGroupPermissionNoRole_code";
Organization organization = new JsonOrganization(code, name, "a", "b", null, null);
organizationFacade.createOrganization(organization);
organizationFacade.removeUserPermission(code, userEmail);
String group = "testGroup3";
Response response = client.target(TARGET_URI).path(PATH_PREFIX + code + "/permissions/groups/" + group).request(MediaType.APPLICATION_JSON).buildDelete().invoke();
assertThat(response.getStatusInfo()).isEqualTo(Response.Status.UNAUTHORIZED);
}
use of io.lumeer.api.dto.JsonOrganization in project engine by Lumeer.
the class OrganizationServicePermissionsIT method testRemoveUserPermissionNoRole.
@Test
public void testRemoveUserPermissionNoRole() {
String name = "testRemoveUserPermissionNoRole";
String code = "testRemoveUserPermissionNoRole_code";
Organization organization = new JsonOrganization(code, name, "a", "b", null, null);
organizationFacade.createOrganization(organization);
organizationFacade.removeUserPermission(code, userEmail);
Response response = client.target(TARGET_URI).path(PATH_PREFIX + code + "/permissions/users/" + userEmail).request(MediaType.APPLICATION_JSON).buildDelete().invoke();
assertThat(response.getStatusInfo()).isEqualTo(Response.Status.UNAUTHORIZED);
}
use of io.lumeer.api.dto.JsonOrganization in project engine by Lumeer.
the class GroupServiceIT method configure.
@Before
public void configure() {
JsonOrganization organization1 = new JsonOrganization();
organization1.setCode("LMR");
organization1.setPermissions(new JsonPermissions());
organization1.getPermissions().updateUserPermissions(new JsonPermission(USER, Role.toStringRoles(new HashSet<>(Arrays.asList(Role.WRITE, Role.READ, Role.MANAGE)))));
organization = organizationDao.createOrganization(organization1);
groupDao.createGroupsRepository(organization);
groupDao.setOrganization(organization);
}
Aggregations