use of io.lumeer.api.model.Permissions in project engine by Lumeer.
the class OrganizationFacadeIT method testGetOrganizationPermissions.
@Test
public void testGetOrganizationPermissions() {
createOrganization(CODE1);
createOrganizationWithReadOnlyPermissions(CODE2);
createOrganizationWithStrangerPermissions(CODE3);
Permissions permissions = organizationFacade.getOrganizationPermissions(CODE1);
assertThat(permissions).isNotNull();
assertPermissions(permissions.getUserPermissions(), USER_PERMISSION);
assertPermissions(permissions.getGroupPermissions(), GROUP_PERMISSION);
permissions = organizationFacade.getOrganizationPermissions(CODE2);
assertThat(permissions).isNotNull();
assertPermissions(permissions.getUserPermissions(), USER_READONLY_PERMISSION);
permissions = organizationFacade.getOrganizationPermissions(CODE3);
assertThat(permissions).isNotNull();
assertThat(permissions.getUserPermissions()).hasSize(2).contains(USER_PERMISSION, STRANGER_PERMISSION);
}
use of io.lumeer.api.model.Permissions 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.api.model.Permissions 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);
}
use of io.lumeer.api.model.Permissions 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.api.model.Permissions 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