use of io.lumeer.api.model.Organization 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.model.Organization 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.model.Organization in project engine by Lumeer.
the class ViewFacadeIT method configureProject.
@Before
public void configureProject() {
MorphiaOrganization organization = new MorphiaOrganization();
organization.setCode(ORGANIZATION_CODE);
organization.setPermissions(new MorphiaPermissions());
Organization storedOrganization = organizationDao.createOrganization(organization);
projectDao.setOrganization(storedOrganization);
workspaceKeeper.setWorkspace(ORGANIZATION_CODE, PROJECT_CODE);
User user = new User(USER);
userDao.createUser(user);
MorphiaProject project = new MorphiaProject();
project.setCode(PROJECT_CODE);
project.setPermissions(new MorphiaPermissions());
Project storedProject = projectDao.createProject(project);
viewDao.setProject(storedProject);
}
use of io.lumeer.api.model.Organization in project engine by Lumeer.
the class OrganizationFacade method deleteOrganization.
public void deleteOrganization(final String organizationCode) {
Organization organization = organizationDao.getOrganizationByCode(organizationCode);
permissionsChecker.checkRole(organization, Role.MANAGE);
deleteOrganizationScopedRepositories(organization);
organizationDao.deleteOrganization(organization.getId());
}
use of io.lumeer.api.model.Organization in project engine by Lumeer.
the class OrganizationFacade method checkRoleAndGetOrganization.
private Organization checkRoleAndGetOrganization(final String organizationCode, final Role role) {
Organization organization = organizationDao.getOrganizationByCode(organizationCode);
permissionsChecker.checkRole(organization, role);
return organization;
}
Aggregations