Search in sources :

Example 66 with Organization

use of io.lumeer.api.model.Organization 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 67 with Organization

use of io.lumeer.api.model.Organization 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 68 with Organization

use of io.lumeer.api.model.Organization 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 69 with Organization

use of io.lumeer.api.model.Organization 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

Organization (io.lumeer.api.model.Organization)69 JsonOrganization (io.lumeer.api.dto.JsonOrganization)42 Test (org.junit.Test)31 JsonPermission (io.lumeer.api.dto.JsonPermission)22 Response (javax.ws.rs.core.Response)20 Before (org.junit.Before)18 User (io.lumeer.api.model.User)17 AuthenticatedUser (io.lumeer.core.AuthenticatedUser)17 Project (io.lumeer.api.model.Project)15 JsonProject (io.lumeer.api.dto.JsonProject)14 JsonPermissions (io.lumeer.api.dto.JsonPermissions)13 MorphiaOrganization (io.lumeer.storage.mongodb.model.MorphiaOrganization)13 JsonCollection (io.lumeer.api.dto.JsonCollection)8 Permission (io.lumeer.api.model.Permission)7 SoftAssertions (org.assertj.core.api.SoftAssertions)6 MorphiaPermissions (io.lumeer.storage.mongodb.model.embedded.MorphiaPermissions)5 ResourceNotFoundException (io.lumeer.storage.api.exception.ResourceNotFoundException)4 MorphiaPermission (io.lumeer.storage.mongodb.model.embedded.MorphiaPermission)4 Role (io.lumeer.api.model.Role)3 DatabaseQuery (io.lumeer.storage.api.query.DatabaseQuery)3