1 16 17 package org.apache.jetspeed.services.security; 18 19 import java.util.Iterator ; 20 21 import org.apache.jetspeed.om.security.Role; 22 import org.apache.turbine.services.TurbineServices; 23 24 34 35 public abstract class JetspeedRoleManagement 36 { 37 public String SERVICE_NAME = "RoleManagement"; 38 39 45 protected static RoleManagement getService() 46 { 47 return (RoleManagement) TurbineServices 48 .getInstance().getService(RoleManagement.SERVICE_NAME); 49 } 50 51 62 public static Iterator getRoles(String username) throws JetspeedSecurityException 63 { 64 return getService().getRoles(username); 65 } 66 67 77 public static Iterator getRoles() throws JetspeedSecurityException 78 { 79 return getService().getRoles(); 80 } 81 82 91 public static void addRole(Role role) throws JetspeedSecurityException 92 { 93 getService().addRole(role); 94 } 95 96 103 public static void saveRole(Role role) throws JetspeedSecurityException 104 { 105 getService().saveRole(role); 106 } 107 108 118 public static void removeRole(String rolename) throws JetspeedSecurityException 119 { 120 getService().removeRole(rolename); 121 } 122 123 132 public static void grantRole(String username, String rolename) throws JetspeedSecurityException 133 { 134 getService().grantRole(username, rolename); 135 } 136 137 146 public static void grantRole(String username, String rolename, String groupname) throws JetspeedSecurityException 147 { 148 getService().grantRole(username, rolename, groupname); 149 } 150 151 160 public static void revokeRole(String username, String rolename) throws JetspeedSecurityException 161 { 162 getService().revokeRole(username, rolename); 163 } 164 165 174 public static void revokeRole(String username, String rolename, String groupname) throws JetspeedSecurityException 175 { 176 getService().revokeRole(username, rolename, groupname); 177 } 178 179 180 189 public static boolean hasRole(String username, String rolename) throws JetspeedSecurityException 190 { 191 return getService().hasRole(username, rolename); 192 } 193 194 public static boolean hasRole(String username, String rolename, String groupname) throws JetspeedSecurityException 195 { 196 return getService().hasRole(username, rolename, groupname); 197 } 198 199 210 public static Role getRole(String rolename) throws JetspeedSecurityException 211 { 212 return getService().getRole(rolename); 213 } 214 215 } 216 | Popular Tags |