001package org.apache.archiva.redback.integration.model; 002 003/* 004 * Licensed to the Apache Software Foundation (ASF) under one 005 * or more contributor license agreements. See the NOTICE file 006 * distributed with this work for additional information 007 * regarding copyright ownership. The ASF licenses this file 008 * to you under the Apache License, Version 2.0 (the 009 * "License"); you may not use this file except in compliance 010 * with the License. You may obtain a copy of the License at 011 * 012 * http://www.apache.org/licenses/LICENSE-2.0 013 * 014 * Unless required by applicable law or agreed to in writing, 015 * software distributed under the License is distributed on an 016 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 017 * KIND, either express or implied. See the License for the 018 * specific language governing permissions and limitations 019 * under the License. 020 */ 021 022import java.util.ArrayList; 023import java.util.List; 024 025/** 026 * RoleDetails - this is a placeholder for information passed back 027 * and forth between the Action and the Client. 028 * 029 * We intentionally do not hook up the actual object to prevent 030 * creative injection of fields and values by the untrusted client. 031 * 032 * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a> 033 * 034 */ 035public abstract class RoleDetails 036{ 037 private String name; 038 039 private String description; 040 041 private boolean assignable; 042 043 private List<String> childRoleNames = new ArrayList<String>(); 044 045 private List<SimplePermission> permissions = new ArrayList<SimplePermission>(); 046 047 public void addChildRoleName( String name ) 048 { 049 childRoleNames.add( name ); 050 } 051 052 public void addPermission( String permissionName, String operationName, String resourceIdentifier ) 053 { 054 SimplePermission permission = new SimplePermission(); 055 permission.setName( permissionName ); 056 permission.setOperationName( operationName ); 057 permission.setResourceIdentifier( resourceIdentifier ); 058 059 permissions.add( permission ); 060 } 061 062 public List<String> getChildRoleNames() 063 { 064 return childRoleNames; 065 } 066 067 public boolean isAssignable() 068 { 069 return assignable; 070 } 071 072 public void setAssignable( boolean assignable ) 073 { 074 this.assignable = assignable; 075 } 076 077 public String getDescription() 078 { 079 return description; 080 } 081 082 public void setDescription( String description ) 083 { 084 this.description = description; 085 } 086 087 public String getName() 088 { 089 return name; 090 } 091 092 public void setName( String name ) 093 { 094 this.name = name; 095 } 096 097 public List<SimplePermission> getPermissions() 098 { 099 return permissions; 100 } 101 102 public void setPermissions( List<SimplePermission> permissions ) 103 { 104 this.permissions = permissions; 105 } 106 107 public void setChildRoleNames( List<String> childRoleNames ) 108 { 109 this.childRoleNames = childRoleNames; 110 } 111}