1 16 17 package org.apache.jetspeed.services.security; 18 19 import java.util.Iterator ; 20 21 22 import org.apache.turbine.services.TurbineServices; 24 25 26 import org.apache.jetspeed.om.security.Permission; 27 28 37 38 public abstract class JetspeedPermissionManagement 39 { 40 public String SERVICE_NAME = "PermissionManagement"; 41 42 48 protected static PermissionManagement getService() 49 { 50 return (PermissionManagement)TurbineServices 51 .getInstance().getService(PermissionManagement.SERVICE_NAME); 52 } 53 54 65 public static Iterator getPermissions(String rolename) 66 throws JetspeedSecurityException 67 { 68 return getService().getPermissions(rolename); 69 } 70 71 81 public static Iterator getPermissions() 82 throws JetspeedSecurityException 83 { 84 return getService().getPermissions(); 85 } 86 87 96 public static void addPermission(Permission permission) 97 throws JetspeedSecurityException 98 { 99 getService().addPermission(permission); 100 } 101 102 111 public static void savePermission(Permission permission) 112 throws JetspeedSecurityException 113 { 114 getService().savePermission(permission); 115 } 116 117 127 public static void removePermission(String permissionName) 128 throws JetspeedSecurityException 129 { 130 getService().removePermission(permissionName); 131 } 132 133 144 public static void grantPermission(String roleName, String permissionName) 145 throws JetspeedSecurityException 146 { 147 getService().grantPermission(roleName, permissionName); 148 } 149 150 161 public static void revokePermission(String roleName, String permissionName) 162 throws JetspeedSecurityException 163 { 164 getService().revokePermission(roleName,permissionName); 165 } 166 167 178 public static boolean hasPermission(String roleName, String permissionName) 179 throws JetspeedSecurityException 180 { 181 return getService().hasPermission(roleName,permissionName); 182 } 183 184 195 public static Permission getPermission(String permissionName) 196 throws JetspeedSecurityException 197 { 198 return getService().getPermission(permissionName); 199 } 200 201 } 202 203 204 205 206 207 208 209 210 211 212 213 | Popular Tags |