1 25 package org.ofbiz.security; 26 27 import java.util.Iterator ; 28 import java.util.List ; 29 30 import javax.servlet.http.HttpSession ; 31 32 import org.ofbiz.base.util.cache.UtilCache; 33 import org.ofbiz.entity.GenericDelegator; 34 import org.ofbiz.entity.GenericValue; 35 36 45 public abstract class Security { 46 47 50 public static UtilCache userLoginSecurityGroupByUserLoginId = new UtilCache("security.UserLoginSecurityGroupByUserLoginId"); 51 52 57 public static UtilCache securityGroupPermissionCache = new UtilCache("security.SecurityGroupPermissionCache"); 58 59 GenericDelegator delegator = null; 60 61 public GenericDelegator getDelegator() { 62 return delegator; 63 } 64 65 public void setDelegator(GenericDelegator delegator) { 66 this.delegator = delegator; 67 } 68 69 76 public abstract Iterator findUserLoginSecurityGroupByUserLoginId(String userLoginId); 77 78 88 public abstract boolean securityGroupPermissionExists(String groupId, String permission); 89 90 97 public abstract boolean hasPermission(String permission, HttpSession session); 98 99 106 public abstract boolean hasPermission(String permission, GenericValue userLogin); 107 108 117 public abstract boolean hasEntityPermission(String entity, String action, HttpSession session); 118 119 128 public abstract boolean hasEntityPermission(String entity, String action, GenericValue userLogin); 129 130 142 public abstract boolean hasRolePermission(String application, String action, String primaryKey, String role, HttpSession session); 143 144 156 public abstract boolean hasRolePermission(String application, String action, String primaryKey, String role, GenericValue userLogin); 157 158 170 public abstract boolean hasRolePermission(String application, String action, String primaryKey, List roles, GenericValue userLogin); 171 172 184 public abstract boolean hasRolePermission(String application, String action, String primaryKey, List roles, HttpSession session); 185 186 } 187 | Popular Tags |