use of io.lumeer.api.model.Project in project engine by Lumeer.
the class ProjectFacade method updateProject.
public Project updateProject(final String projectCode, final Project project) {
Project storedProject = projectDao.getProjectByCode(projectCode);
permissionsChecker.checkRole(storedProject, Role.MANAGE);
keepStoredPermissions(project, storedProject.getPermissions());
Project updatedProject = projectDao.updateProject(storedProject.getId(), project);
return keepOnlyActualUserRoles(updatedProject);
}
use of io.lumeer.api.model.Project in project engine by Lumeer.
the class ProjectFacade method updateGroupPermissions.
public Set<Permission> updateGroupPermissions(final String projectCode, final Permission... groupPermissions) {
Project project = projectDao.getProjectByCode(projectCode);
permissionsChecker.checkRole(project, Role.MANAGE);
project.getPermissions().updateGroupPermissions(groupPermissions);
projectDao.updateProject(project.getId(), project);
return project.getPermissions().getGroupPermissions();
}
use of io.lumeer.api.model.Project in project engine by Lumeer.
the class ProjectFacade method getProject.
public Project getProject(final String projectCode) {
Project project = projectDao.getProjectByCode(projectCode);
permissionsChecker.checkRole(project, Role.READ);
return keepOnlyActualUserRoles(project);
}
use of io.lumeer.api.model.Project in project engine by Lumeer.
the class ProjectFacade method updateUserPermissions.
public Set<Permission> updateUserPermissions(final String projectCode, final Permission... userPermissions) {
Project project = projectDao.getProjectByCode(projectCode);
permissionsChecker.checkRole(project, Role.MANAGE);
project.getPermissions().updateUserPermissions(userPermissions);
projectDao.updateProject(project.getId(), project);
return project.getPermissions().getUserPermissions();
}
use of io.lumeer.api.model.Project in project engine by Lumeer.
the class ProjectFacade method deleteProject.
public void deleteProject(final String projectCode) {
Project project = projectDao.getProjectByCode(projectCode);
permissionsChecker.checkRole(project, Role.MANAGE);
deleleProjectScopedRepositories(project);
projectDao.deleteProject(project.getId());
}
Aggregations