use of io.lumeer.api.model.AppId in project engine by Lumeer.
the class PusherAdapterIT method configureProject.
@Before
public void configureProject() {
user = userDao.createUser(new User(USER));
otherUser = userDao.createUser(new User("otherUser"));
Organization organization = new Organization();
organization.setCode(ORGANIZATION_CODE);
Permissions organizationPermissions = new Permissions();
final Permission userPermission = Permission.buildWithRoles(this.user.getId(), READ_ROLES);
organizationPermissions.updateUserPermissions(userPermission);
organization.setPermissions(organizationPermissions);
this.organization = organizationDao.createOrganization(organization);
projectDao.setOrganization(this.organization);
groupDao.setOrganization(this.organization);
group = groupDao.createGroup(new Group(GROUP, List.of(user.getId(), otherUser.getId())));
user.setOrganizations(Collections.singleton(this.organization.getId()));
user = userDao.updateUser(user.getId(), user);
otherUser.setOrganizations(Collections.singleton(this.organization.getId()));
otherUser = userDao.updateUser(otherUser.getId(), otherUser);
Project project = new Project();
project.setCode(PROJECT_CODE);
Permissions projectPermissions = new Permissions();
projectPermissions.updateUserPermissions(Permission.buildWithRoles(this.user.getId(), READ_ROLES));
project.setPermissions(projectPermissions);
this.project = projectDao.createProject(project);
collectionDao.setProject(project);
viewDao.setProject(project);
linkTypeDao.setProject(project);
FacadeAdapter facadeAdapter = new FacadeAdapter(permissionsChecker.getPermissionAdapter());
ResourceAdapter resourceAdapter = new ResourceAdapter(permissionsChecker.getPermissionAdapter(), collectionDao, linkTypeDao, viewDao, userDao);
pusherAdapter = new PusherAdapter(new AppId(""), facadeAdapter, resourceAdapter, permissionsChecker.getPermissionAdapter(), viewDao, linkTypeDao, collectionDao);
permissionsChecker.getPermissionAdapter().invalidateUserCache();
}
Aggregations