Search in sources :

Example 6 with ProjectPermissions

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();
}
Also used : Locale(java.util.Locale) Project(com.enonic.xp.project.Project) ProjectPermissions(com.enonic.xp.project.ProjectPermissions)

Aggregations

ProjectPermissions (com.enonic.xp.project.ProjectPermissions)6 Project (com.enonic.xp.project.Project)4 Locale (java.util.Locale)3 CreateProjectParams (com.enonic.xp.project.CreateProjectParams)2 ModifyProjectParams (com.enonic.xp.project.ModifyProjectParams)2 ProjectPermissionsMapper (com.enonic.xp.lib.project.mapper.ProjectPermissionsMapper)1 ProjectName (com.enonic.xp.project.ProjectName)1 HashMap (java.util.HashMap)1