Search in sources :

Example 1 with MorphiaPermissions

use of io.lumeer.storage.mongodb.model.embedded.MorphiaPermissions in project engine by Lumeer.

the class MorphiaViewDaoTest method prepareView.

private MorphiaView prepareView() {
    MorphiaView view = new MorphiaView();
    view.setCode(CODE);
    view.setName(NAME);
    view.setColor(COLOR);
    view.setIcon(ICON);
    view.setPermissions(new MorphiaPermissions(PERMISSIONS));
    view.setQuery(QUERY);
    view.setPerspective(PERSPECTIVE);
    view.setConfig(CONFIG);
    return view;
}
Also used : MorphiaView(io.lumeer.storage.mongodb.model.MorphiaView) MorphiaPermissions(io.lumeer.storage.mongodb.model.embedded.MorphiaPermissions)

Example 2 with MorphiaPermissions

use of io.lumeer.storage.mongodb.model.embedded.MorphiaPermissions in project engine by Lumeer.

the class MorphiaOrganizationDaoTest method prepareOrganization.

private MorphiaOrganization prepareOrganization(String code) {
    MorphiaOrganization organization = new MorphiaOrganization();
    organization.setCode(code);
    organization.setName(NAME);
    organization.setColor(COLOR);
    organization.setIcon(ICON);
    organization.setPermissions(new MorphiaPermissions(PERMISSIONS));
    return organization;
}
Also used : MorphiaOrganization(io.lumeer.storage.mongodb.model.MorphiaOrganization) MorphiaPermissions(io.lumeer.storage.mongodb.model.embedded.MorphiaPermissions)

Example 3 with MorphiaPermissions

use of io.lumeer.storage.mongodb.model.embedded.MorphiaPermissions in project engine by Lumeer.

the class ProjectFacadeIT method configureProject.

@Before
public void configureProject() {
    MorphiaOrganization organization = new MorphiaOrganization();
    organization.setCode(ORGANIZATION_CODE);
    organization.setPermissions(new MorphiaPermissions());
    organization.getPermissions().updateUserPermissions(new MorphiaPermission(USER, Role.toStringRoles(new HashSet<>(Arrays.asList(Role.WRITE, Role.READ, Role.MANAGE)))));
    Organization storedOrganization = organizationDao.createOrganization(organization);
    projectDao.setOrganization(storedOrganization);
    User user = new User(USER);
    userDao.createUser(user);
    workspaceKeeper.setOrganization(ORGANIZATION_CODE);
}
Also used : Organization(io.lumeer.api.model.Organization) MorphiaOrganization(io.lumeer.storage.mongodb.model.MorphiaOrganization) User(io.lumeer.api.model.User) AuthenticatedUser(io.lumeer.core.AuthenticatedUser) MorphiaPermission(io.lumeer.storage.mongodb.model.embedded.MorphiaPermission) MorphiaOrganization(io.lumeer.storage.mongodb.model.MorphiaOrganization) MorphiaPermissions(io.lumeer.storage.mongodb.model.embedded.MorphiaPermissions) Before(org.junit.Before)

Example 4 with MorphiaPermissions

use of io.lumeer.storage.mongodb.model.embedded.MorphiaPermissions in project engine by Lumeer.

the class ProjectServiceIT method configureProject.

@Before
public void configureProject() {
    MorphiaOrganization organization = new MorphiaOrganization();
    organization.setCode(ORGANIZATION_CODE);
    organization.setPermissions(new MorphiaPermissions());
    organization.getPermissions().updateUserPermissions(new MorphiaPermission(USER, Role.toStringRoles(new HashSet<>(Arrays.asList(Role.WRITE, Role.READ, Role.MANAGE)))));
    Organization storedOrganization = organizationDao.createOrganization(organization);
    projectDao.setOrganization(storedOrganization);
    User user = new User(USER);
    userDao.createUser(user);
}
Also used : Organization(io.lumeer.api.model.Organization) MorphiaOrganization(io.lumeer.storage.mongodb.model.MorphiaOrganization) User(io.lumeer.api.model.User) AuthenticatedUser(io.lumeer.core.AuthenticatedUser) MorphiaPermission(io.lumeer.storage.mongodb.model.embedded.MorphiaPermission) MorphiaOrganization(io.lumeer.storage.mongodb.model.MorphiaOrganization) MorphiaPermissions(io.lumeer.storage.mongodb.model.embedded.MorphiaPermissions) Before(org.junit.Before)

Example 5 with MorphiaPermissions

use of io.lumeer.storage.mongodb.model.embedded.MorphiaPermissions 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);
}
Also used : MorphiaProject(io.lumeer.storage.mongodb.model.MorphiaProject) Project(io.lumeer.api.model.Project) Organization(io.lumeer.api.model.Organization) MorphiaOrganization(io.lumeer.storage.mongodb.model.MorphiaOrganization) User(io.lumeer.api.model.User) AuthenticatedUser(io.lumeer.core.AuthenticatedUser) MorphiaOrganization(io.lumeer.storage.mongodb.model.MorphiaOrganization) MorphiaProject(io.lumeer.storage.mongodb.model.MorphiaProject) MorphiaPermissions(io.lumeer.storage.mongodb.model.embedded.MorphiaPermissions) Before(org.junit.Before)

Aggregations

MorphiaPermissions (io.lumeer.storage.mongodb.model.embedded.MorphiaPermissions)10 MorphiaOrganization (io.lumeer.storage.mongodb.model.MorphiaOrganization)6 Organization (io.lumeer.api.model.Organization)5 User (io.lumeer.api.model.User)5 AuthenticatedUser (io.lumeer.core.AuthenticatedUser)5 Before (org.junit.Before)5 MorphiaProject (io.lumeer.storage.mongodb.model.MorphiaProject)3 MorphiaPermission (io.lumeer.storage.mongodb.model.embedded.MorphiaPermission)3 Project (io.lumeer.api.model.Project)2 JsonOrganization (io.lumeer.api.dto.JsonOrganization)1 JsonView (io.lumeer.api.dto.JsonView)1 MorphiaCollection (io.lumeer.storage.mongodb.model.MorphiaCollection)1 MorphiaView (io.lumeer.storage.mongodb.model.MorphiaView)1