use of io.lumeer.core.model.SimplePermission 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);
}
use of io.lumeer.core.model.SimplePermission in project engine by Lumeer.
the class ProjectFacadeIT method testUpdateGroupPermissions.
@Test
public void testUpdateGroupPermissions() {
createProject(CODE1);
SimplePermission groupPermission = new SimplePermission(GROUP, new HashSet<>(Arrays.asList(Role.SHARE, Role.READ)));
projectFacade.updateGroupPermissions(CODE1, groupPermission);
Permissions permissions = projectDao.getProjectByCode(CODE1).getPermissions();
Assertions.assertThat(permissions).isNotNull();
assertPermissions(permissions.getUserPermissions(), USER_PERMISSION);
assertPermissions(permissions.getGroupPermissions(), groupPermission);
}
use of io.lumeer.core.model.SimplePermission in project engine by Lumeer.
the class ProjectFacadeIT method createProjectWithStrangerPermissions.
private Project createProjectWithStrangerPermissions(final String code) {
Project project = new JsonProject(code, NAME, ICON, COLOR, null, null);
project.getPermissions().updateUserPermissions(USER_PERMISSION, new SimplePermission(STRANGER_USER, Collections.singleton(Role.MANAGE)));
project.getPermissions().updateGroupPermissions(GROUP_PERMISSION);
return projectDao.createProject(project);
}
use of io.lumeer.core.model.SimplePermission in project engine by Lumeer.
the class ProjectFacadeIT method testUpdateUserPermissions.
@Test
public void testUpdateUserPermissions() {
createProject(CODE1);
SimplePermission userPermission = new SimplePermission(USER, new HashSet<>(Arrays.asList(Role.MANAGE, Role.READ)));
projectFacade.updateUserPermissions(CODE1, userPermission);
Permissions permissions = projectDao.getProjectByCode(CODE1).getPermissions();
Assertions.assertThat(permissions).isNotNull();
assertPermissions(permissions.getUserPermissions(), userPermission);
assertPermissions(permissions.getGroupPermissions(), GROUP_PERMISSION);
}
Aggregations