Search in sources :

Example 6 with MorphiaPermissions

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

the class MorphiaProjectDaoTest method prepareProject.

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

Example 7 with MorphiaPermissions

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

the class MongoViewDaoTest method prepareView.

private JsonView prepareView() {
    JsonView view = new JsonView();
    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 : JsonView(io.lumeer.api.dto.JsonView) MorphiaPermissions(io.lumeer.storage.mongodb.model.embedded.MorphiaPermissions)

Example 8 with MorphiaPermissions

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

the class MorphiaCollectionDaoTest method prepareCollection.

private MorphiaCollection prepareCollection(String code, String name) {
    MorphiaCollection collection = new MorphiaCollection();
    collection.setCode(code);
    collection.setName(name);
    collection.setColor(COLOR);
    collection.setIcon(ICON);
    collection.setPermissions(new MorphiaPermissions(PERMISSIONS));
    collection.setAttributes(ATTRIBUTES);
    collection.setDocumentsCount(DOCUMENTS_COUNT);
    collection.setLastTimeUsed(LAST_TIME_USED);
    return collection;
}
Also used : MorphiaCollection(io.lumeer.storage.mongodb.model.MorphiaCollection) MorphiaPermissions(io.lumeer.storage.mongodb.model.embedded.MorphiaPermissions)

Example 9 with MorphiaPermissions

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

the class ViewServiceIT 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);
    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)

Example 10 with MorphiaPermissions

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

the class ProjectServicePermissionsIT method configureProject.

@Before
public void configureProject() {
    MorphiaOrganization organization = new MorphiaOrganization();
    organization.setCode(organizationCode);
    organization.setName(organizationName);
    organization.setPermissions(new MorphiaPermissions());
    organization.getPermissions().updateUserPermissions(new MorphiaPermission(userEmail, Role.toStringRoles(new HashSet<>(Arrays.asList(Role.WRITE, Role.READ, Role.MANAGE)))));
    Organization storedOrganization = organizationDao.createOrganization(organization);
    projectDao.setOrganization(storedOrganization);
    workspaceKeeper.setOrganization(organizationCode);
    User user = new User(userEmail);
    userDao.createUser(user);
}
Also used : Organization(io.lumeer.api.model.Organization) JsonOrganization(io.lumeer.api.dto.JsonOrganization) 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)

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