1package org.apache.archiva.redback.integration.model;
23/*4 * Licensed to the Apache Software Foundation (ASF) under one5 * or more contributor license agreements. See the NOTICE file6 * distributed with this work for additional information7 * regarding copyright ownership. The ASF licenses this file8 * to you under the Apache License, Version 2.0 (the9 * "License"); you may not use this file except in compliance10 * with the License. You may obtain a copy of the License at11 *12 * http://www.apache.org/licenses/LICENSE-2.013 *14 * Unless required by applicable law or agreed to in writing,15 * software distributed under the License is distributed on an16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY17 * KIND, either express or implied. See the License for the18 * specific language governing permissions and limitations19 * under the License.20 */2122import java.util.ArrayList;
23import java.util.List;
2425/**26 * RoleDetails - this is a placeholder for information passed back27 * and forth between the Action and the Client.28 * <p/>29 * We intentionally do not hook up the actual object to prevent30 * creative injection of fields and values by the untrusted client.31 *32 * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>33 *34 */35publicabstractclassRoleDetails36 {
37private String name;
3839private String description;
4041privateboolean assignable;
4243private List<String> childRoleNames = new ArrayList<String>();
4445private List<SimplePermission> permissions = new ArrayList<SimplePermission>();
4647publicvoid addChildRoleName( String name )
48 {
49 childRoleNames.add( name );
50 }
5152publicvoid addPermission( String permissionName, String operationName, String resourceIdentifier )
53 {
54SimplePermission permission = newSimplePermission();
55 permission.setName( permissionName );
56 permission.setOperationName( operationName );
57 permission.setResourceIdentifier( resourceIdentifier );
5859 permissions.add( permission );
60 }
6162public List<String> getChildRoleNames()
63 {
64return childRoleNames;
65 }
6667publicboolean isAssignable()
68 {
69return assignable;
70 }
7172publicvoid setAssignable( boolean assignable )
73 {
74this.assignable = assignable;
75 }
7677public String getDescription()
78 {
79return description;
80 }
8182publicvoid setDescription( String description )
83 {
84this.description = description;
85 }
8687public String getName()
88 {
89return name;
90 }
9192publicvoid setName( String name )
93 {
94this.name = name;
95 }
9697public List<SimplePermission> getPermissions()
98 {
99return permissions;
100 }
101102publicvoid setPermissions( List<SimplePermission> permissions )
103 {
104this.permissions = permissions;
105 }
106107publicvoid setChildRoleNames( List<String> childRoleNames )
108 {
109this.childRoleNames = childRoleNames;
110 }
111 }