1 16 17 package org.apache.jetspeed.services.security.nosecurity; 18 19 import java.util.Iterator ; 20 import java.util.Vector ; 21 22 import org.apache.jetspeed.services.security.RoleManagement; 24 25 import org.apache.jetspeed.om.security.Role; 26 27 import org.apache.jetspeed.services.JetspeedSecurity; 28 import org.apache.jetspeed.om.security.BaseJetspeedRole; 29 30 import org.apache.jetspeed.services.security.JetspeedSecurityException; 32 33 import org.apache.turbine.services.TurbineBaseService; 35 36 45 public class NoRoleManagement 46 extends TurbineBaseService 47 implements RoleManagement 48 { 49 60 public Iterator getRoles(String username) 61 throws JetspeedSecurityException 62 { 63 Vector v = new Vector (1); 65 BaseJetspeedRole r = new BaseJetspeedRole(); 66 r.setName(JetspeedSecurity.JETSPEED_ROLE_USER); 68 r.setId(JetspeedSecurity.JETSPEED_ROLE_USER); 69 v.add(r); 70 return v.iterator(); 71 } 72 73 83 public Iterator getRoles() 84 throws JetspeedSecurityException 85 { 86 return new Vector ().iterator(); 87 } 88 89 98 public void addRole(Role role) 99 throws JetspeedSecurityException 100 { 101 } 102 103 112 public void saveRole(Role role) 113 throws JetspeedSecurityException 114 { 115 } 116 117 127 public void removeRole(String rolename) 128 throws JetspeedSecurityException 129 { 130 } 131 132 141 public void grantRole(String username, String rolename) 142 throws JetspeedSecurityException 143 { 144 } 145 146 public void grantRole(String username, String rolename, String groupname) 147 throws JetspeedSecurityException 148 { 149 } 150 151 160 public void grantGroupRole(String username, String groupname, String rolename) 161 throws JetspeedSecurityException 162 { 163 } 164 165 174 public void revokeRole(String username, String rolename) 175 throws JetspeedSecurityException 176 { 177 } 178 179 188 public void revokeRole(String username, String rolename, String groupname) 189 throws JetspeedSecurityException 190 { 191 } 192 193 202 public boolean hasRole(String username, String rolename) 203 throws JetspeedSecurityException 204 { 205 if (rolename.equals(JetspeedSecurity.JETSPEED_ROLE_USER)) return true; 207 208 return false; 209 } 210 211 public boolean hasRole(String username, String rolename, String groupname) 212 throws JetspeedSecurityException 213 { 214 if (rolename.equals(JetspeedSecurity.JETSPEED_ROLE_USER) && 216 groupname.equals(JetspeedSecurity.JETSPEED_GROUP)) return true; 217 218 return false; 219 } 220 221 232 public Role getRole(String rolename) 233 throws JetspeedSecurityException 234 { 235 BaseJetspeedRole r = new BaseJetspeedRole(); 236 r.setName(rolename); 238 r.setId(rolename); 239 return r; 240 } 241 } 242 243 | Popular Tags |