1 package org.apache.turbine.om.security; 2 3 18 19 import java.sql.Connection ; 20 import java.util.Iterator ; 21 22 import org.apache.turbine.services.security.TurbineSecurity; 23 import org.apache.turbine.util.security.RoleSet; 24 import org.apache.turbine.util.security.TurbineSecurityException; 25 26 42 public class TurbineGroup extends SecurityObject implements Group 43 { 44 47 public TurbineGroup() 48 { 49 super(); 50 } 51 52 57 public TurbineGroup(String name) 58 { 59 super(name); 60 } 61 62 64 69 public void save() throws TurbineSecurityException 70 { 71 TurbineSecurity.saveGroup(this); 72 } 73 74 80 public void save(Connection conn) throws Exception 81 { 82 throw new Exception ("not implemented"); 83 } 84 85 91 public void save(String dbname) throws Exception 92 { 93 throw new Exception ("not implemented"); 94 } 95 96 101 public void remove() throws TurbineSecurityException 102 { 103 TurbineSecurity.removeGroup(this); 104 } 105 106 112 public void rename(String name) throws TurbineSecurityException 113 { 114 TurbineSecurity.renameGroup(this, name); 115 } 116 117 125 public void grant(User user, Role role) throws TurbineSecurityException 126 { 127 TurbineSecurity.grant(user, this, role); 128 } 129 130 138 public void grant(User user, RoleSet roleSet) 139 throws TurbineSecurityException 140 { 141 for (Iterator roles = roleSet.iterator(); roles.hasNext();) 142 { 143 TurbineSecurity.grant(user, this, (Role) roles.next()); 144 } 145 } 146 147 155 public void revoke(User user, Role role) throws TurbineSecurityException 156 { 157 TurbineSecurity.revoke(user, this, role); 158 } 159 160 168 public void revoke(User user, RoleSet roleSet) 169 throws TurbineSecurityException 170 { 171 for (Iterator roles = roleSet.iterator(); roles.hasNext();) 172 { 173 TurbineSecurity.revoke(user, this, (Role) roles.next()); 174 } 175 } 176 } 177 | Popular Tags |