@@ -0,0 +1,2568 @@
+/*%0A * Copyright 2018 EPAM Systems%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A * http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage com.epam.ta.reportportal.commons;%0A%0Aimport com.epam.ta.reportportal.entity.project.ProjectRole;%0Aimport com.epam.ta.reportportal.entity.user.UserRole;%0Aimport org.springframework.security.core.GrantedAuthority;%0Aimport org.springframework.security.core.userdetails.User;%0A%0Aimport java.util.Collection;%0Aimport java.util.Map;%0A%0A/**%0A * ReportPortal user representation%0A *%0A * @author %3Ca href=%22mailto:andrei_varabyeu@epam.com%22%3EAndrei Varabyeu%3C/a%3E%0A */%0Apublic class ReportPortalUser extends User %7B%0A%0A%09private Long userId;%0A%0A%09private UserRole userRole;%0A%0A%09private String email;%0A%0A%09private Map%3CString, ProjectDetails%3E projectDetails;%0A%0A%09public ReportPortalUser(String username, String password, Collection%3C? extends GrantedAuthority%3E authorities, Long userId,%0A%09%09%09UserRole role, Map%3CString, ProjectDetails%3E projectDetails, String email) %7B%0A%09%09super(username, password, authorities);%0A%09%09this.userId = userId;%0A%09%09this.userRole = role;%0A%09%09this.projectDetails = projectDetails;%0A%09%09this.email = email;%0A%09%7D%0A%0A%09public ReportPortalUser(User user, Long userId, UserRole role, Map%3CString, ProjectDetails%3E projectDetails, String email) %7B%0A%09%09this(user.getUsername(), user.getPassword(), user.getAuthorities(), userId, role, projectDetails, email);%0A%09%7D%0A%0A%09public Long getUserId() %7B%0A%09%09return userId;%0A%09%7D%0A%0A%09public UserRole getUserRole() %7B%0A%09%09return userRole;%0A%09%7D%0A%0A%09public String getEmail() %7B%0A%09%09return email;%0A%09%7D%0A%0A%09public Map%3CString, ProjectDetails%3E getProjectDetails() %7B%0A%09%09return projectDetails;%0A%09%7D%0A%0A%09public static class ProjectDetails %7B%0A%0A%09%09private Long projectId;%0A%0A%09%09private String projectName;%0A%0A%09%09private ProjectRole projectRole;%0A%0A%09%09public ProjectDetails(Long projectId, String projectName, ProjectRole projectRole) %7B%0A%09%09%09this.projectId = projectId;%0A%09%09%09this.projectName = projectName;%0A%09%09%09this.projectRole = projectRole;%0A%09%09%7D%0A%0A%09%09public Long getProjectId() %7B%0A%09%09%09return projectId;%0A%09%09%7D%0A%0A%09%09public String getProjectName() %7B%0A%09%09%09return projectName;%0A%09%09%7D%0A%0A%09%09public ProjectRole getProjectRole() %7B%0A%09%09%09return projectRole;%0A%09%09%7D%0A%09%7D%0A%7D%0A

add reportportal user object