use of io.lumeer.core.model.SimplePermission in project engine by Lumeer.
the class ProjectServicePermissionsIT method createProject.
private Project createProject(String code, String name) {
Project project = new JsonProject(code, name, "a", "b", null, null);
project.getPermissions().updateUserPermissions(new SimplePermission(userEmail, Project.ROLES));
return projectDao.createProject(project);
}
use of io.lumeer.core.model.SimplePermission in project engine by Lumeer.
the class ViewFacadeIT method testUpdateGroupPermissions.
@Test
public void testUpdateGroupPermissions() {
createView(CODE);
SimplePermission groupPermission = new SimplePermission(GROUP, new HashSet<>(Arrays.asList(Role.SHARE, Role.READ)));
viewFacade.updateGroupPermissions(CODE, groupPermission);
Permissions permissions = viewDao.getViewByCode(CODE).getPermissions();
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 ViewFacadeIT method testUpdateUserPermissions.
@Test
public void testUpdateUserPermissions() {
createView(CODE);
SimplePermission userPermission = new SimplePermission(USER, new HashSet<>(Arrays.asList(Role.MANAGE, Role.READ)));
viewFacade.updateUserPermissions(CODE, userPermission);
Permissions permissions = viewDao.getViewByCode(CODE).getPermissions();
assertThat(permissions).isNotNull();
assertPermissions(permissions.getUserPermissions(), userPermission);
assertPermissions(permissions.getGroupPermissions(), GROUP_PERMISSION);
}
use of io.lumeer.core.model.SimplePermission in project engine by Lumeer.
the class OrganizationFacadeIT method testUpdateUserPermissions.
@Test
public void testUpdateUserPermissions() {
createOrganization(CODE1);
SimplePermission userPermission = new SimplePermission(USER, new HashSet<>(Arrays.asList(Role.MANAGE, Role.READ)));
organizationFacade.updateUserPermissions(CODE1, userPermission);
Permissions permissions = organizationDao.getOrganizationByCode(CODE1).getPermissions();
assertThat(permissions).isNotNull();
assertPermissions(permissions.getUserPermissions(), userPermission);
assertPermissions(permissions.getGroupPermissions(), GROUP_PERMISSION);
}
use of io.lumeer.core.model.SimplePermission in project engine by Lumeer.
the class OrganizationFacadeIT method testUpdateGroupPermissions.
@Test
public void testUpdateGroupPermissions() {
createOrganization(CODE1);
SimplePermission groupPermission = new SimplePermission(GROUP, new HashSet<>(Arrays.asList(Role.SHARE, Role.READ)));
organizationFacade.updateGroupPermissions(CODE1, groupPermission);
Permissions permissions = organizationDao.getOrganizationByCode(CODE1).getPermissions();
assertThat(permissions).isNotNull();
assertPermissions(permissions.getUserPermissions(), USER_PERMISSION);
assertPermissions(permissions.getGroupPermissions(), groupPermission);
}
Aggregations