Search in sources :

Example 41 with JsonOrganization

use of io.lumeer.api.dto.JsonOrganization in project engine by Lumeer.

the class GroupFacadeIT 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);
    workspaceKeeper.setOrganization(organization.getCode());
    groupDao.createGroupsRepository(organization);
    groupDao.setOrganization(organization);
}
Also used : JsonPermissions(io.lumeer.api.dto.JsonPermissions) JsonOrganization(io.lumeer.api.dto.JsonOrganization) JsonPermission(io.lumeer.api.dto.JsonPermission) Before(org.junit.Before)

Example 42 with JsonOrganization

use of io.lumeer.api.dto.JsonOrganization in project engine by Lumeer.

the class GroupFacadeIT method setOrganizationWithoutPermissions.

private void setOrganizationWithoutPermissions() {
    JsonOrganization organization3 = new JsonOrganization();
    organization3.setCode("RML");
    organization3.setPermissions(new JsonPermissions());
    Organization organizationNotPermission = organizationDao.createOrganization(organization3);
    workspaceKeeper.setOrganization(organizationNotPermission.getCode());
    groupDao.createGroupsRepository(organizationNotPermission);
    groupDao.setOrganization(organizationNotPermission);
}
Also used : JsonPermissions(io.lumeer.api.dto.JsonPermissions) Organization(io.lumeer.api.model.Organization) JsonOrganization(io.lumeer.api.dto.JsonOrganization) JsonOrganization(io.lumeer.api.dto.JsonOrganization)

Example 43 with JsonOrganization

use of io.lumeer.api.dto.JsonOrganization in project engine by Lumeer.

the class OrganizationFacadeIT method createOrganizationWithStrangerPermissions.

private void createOrganizationWithStrangerPermissions(final String code) {
    Organization organization = new JsonOrganization(code, NAME, ICON, COLOR, null, null);
    organization.getPermissions().updateUserPermissions(USER_PERMISSION, new SimplePermission(STRANGER_USER, Collections.singleton(Role.MANAGE)));
    organization.getPermissions().updateGroupPermissions(GROUP_PERMISSION);
    organizationDao.createOrganization(organization);
}
Also used : JsonOrganization(io.lumeer.api.dto.JsonOrganization) Organization(io.lumeer.api.model.Organization) JsonOrganization(io.lumeer.api.dto.JsonOrganization) SimplePermission(io.lumeer.core.model.SimplePermission)

Example 44 with JsonOrganization

use of io.lumeer.api.dto.JsonOrganization in project engine by Lumeer.

the class OrganizationFacadeIT method createOrganization.

private String createOrganization(final String code) {
    Organization organization = new JsonOrganization(code, NAME, ICON, COLOR, null, null);
    organization.getPermissions().updateUserPermissions(USER_PERMISSION);
    organization.getPermissions().updateGroupPermissions(GROUP_PERMISSION);
    return organizationDao.createOrganization(organization).getId();
}
Also used : JsonOrganization(io.lumeer.api.dto.JsonOrganization) Organization(io.lumeer.api.model.Organization) JsonOrganization(io.lumeer.api.dto.JsonOrganization)

Example 45 with JsonOrganization

use of io.lumeer.api.dto.JsonOrganization in project engine by Lumeer.

the class OrganizationFacadeIT method createOrganizationWithReadOnlyPermissions.

private void createOrganizationWithReadOnlyPermissions(final String code) {
    Organization organization = new JsonOrganization(code, NAME, ICON, COLOR, null, null);
    organization.getPermissions().updateUserPermissions(USER_READONLY_PERMISSION, STRANGER_PERMISSION);
    organization.getPermissions().updateGroupPermissions(GROUP_PERMISSION);
    organizationDao.createOrganization(organization);
}
Also used : JsonOrganization(io.lumeer.api.dto.JsonOrganization) Organization(io.lumeer.api.model.Organization) JsonOrganization(io.lumeer.api.dto.JsonOrganization)

Aggregations

JsonOrganization (io.lumeer.api.dto.JsonOrganization)45 Organization (io.lumeer.api.model.Organization)40 JsonPermission (io.lumeer.api.dto.JsonPermission)28 Test (org.junit.Test)23 Response (javax.ws.rs.core.Response)21 JsonPermissions (io.lumeer.api.dto.JsonPermissions)18 Before (org.junit.Before)16 JsonProject (io.lumeer.api.dto.JsonProject)14 Project (io.lumeer.api.model.Project)13 AuthenticatedUser (io.lumeer.core.AuthenticatedUser)13 User (io.lumeer.api.model.User)12 JsonCollection (io.lumeer.api.dto.JsonCollection)8 Permission (io.lumeer.api.model.Permission)6 Role (io.lumeer.api.model.Role)4 SoftAssertions (org.assertj.core.api.SoftAssertions)4 Entity (javax.ws.rs.client.Entity)3 LinkType (io.lumeer.api.model.LinkType)2 SimplePermission (io.lumeer.core.model.SimplePermission)2 List (java.util.List)2 CompanyContact (io.lumeer.api.model.CompanyContact)1