001package org.apache.archiva.redback.rest.api.model.v2;/* 002 * Licensed to the Apache Software Foundation (ASF) under one 003 * or more contributor license agreements. See the NOTICE file 004 * distributed with this work for additional information 005 * regarding copyright ownership. The ASF licenses this file 006 * to you under the Apache License, Version 2.0 (the 007 * "License"); you may not use this file except in compliance 008 * with the License. You may obtain a copy of the License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * Unless required by applicable law or agreed to in writing, 012 * software distributed under the License is distributed on an 013 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 014 * KIND, either express or implied. See the License for the 015 * specific language governing permissions and limitations 016 * under the License. 017 */ 018 019import io.swagger.v3.oas.annotations.media.Schema; 020 021import java.io.Serializable; 022import java.util.List; 023import java.util.Map; 024 025/** 026 * Information about roles of a application. 027 * 028 * @author Martin Stockhammer <martin_s@apache.org> 029 */ 030@Schema(name="RoleTree",description = "Tree of roles defined. The root roles have no parent. Each role may have children recursively.") 031public class RoleTree implements Serializable 032{ 033 private static final long serialVersionUID = 6893397477073625729L; 034 035 String userId; 036 Map<String, Application> applications; 037 List<BaseRoleInfo> rootRoles; 038 039 @Schema(name="user_id", description = "The user id for which the assigned flags are set on the roles.") 040 public String getUserId( ) 041 { 042 return userId; 043 } 044 045 public void setUserId( String userId ) 046 { 047 this.userId = userId; 048 } 049 050 @Schema(description = "Information about the applications that define roles. The keys of the map are the application ids.") 051 public Map<String, Application> getApplications( ) 052 { 053 return applications; 054 } 055 056 public void setApplications( Map<String, Application> applications ) 057 { 058 this.applications = applications; 059 } 060 061 062 @Schema(name="root_roles", description = "The list of roles directly assigned to this application. Roles may contain children roles.") 063 public List<BaseRoleInfo> getRootRoles( ) 064 { 065 return rootRoles; 066 } 067 068 public void setRootRoles( List<BaseRoleInfo> rootRoles ) 069 { 070 this.rootRoles = rootRoles; 071 } 072 073 074}