use of com.enonic.xp.project.ProjectPermissions in project xp by enonic.
the class GetProjectHandler method doExecute.
@Override
protected ProjectMapper doExecute() {
final Project project = this.projectService.get(this.id);
if (project == null) {
return null;
}
final ProjectPermissions projectPermissions = !ProjectConstants.DEFAULT_PROJECT_NAME.equals(project.getName()) ? this.projectService.getPermissions(project.getName()) : null;
final Boolean readAccess = !ProjectConstants.DEFAULT_PROJECT_NAME.equals(project.getName()) ? GetProjectReadAccessCommand.create().contentService(this.contentService).projectName(project.getName()).build().execute() : null;
final Locale language = GetProjectLanguageCommand.create().projectName(this.id).contentService(this.contentService).build().execute();
return ProjectMapper.create().setProject(project).setLanguage(language).setProjectPermissions(projectPermissions).setIsPublic(readAccess).build();
}
Aggregations