1 package com.sslexplorer.policyframework; 2 3 import java.util.List ; 4 5 import com.sslexplorer.boot.PropertyList; 6 import com.sslexplorer.core.Database; 7 import com.sslexplorer.realms.Realm; 8 import com.sslexplorer.security.SessionInfo; 9 import com.sslexplorer.security.User; 10 11 18 public interface PolicyDatabase extends Database { 19 25 public void registerResourceType(ResourceType resourceType) throws Exception ; 26 27 33 public void deregisterResourceType(ResourceType resourceType) throws Exception ; 34 35 40 public int getResourceTypeCount(); 41 42 43 50 public List getResourceTypes(String permissionClass) throws Exception ; 51 52 59 public Policy getPolicy(int id) throws Exception ; 60 61 67 public void updatePolicy(Policy policy) throws Exception ; 68 69 80 public Policy createPolicy(String name, String description, int type, int realmID) throws Exception ; 81 82 90 public Policy deletePolicy(int id) throws Exception ; 91 92 99 public List getPolicies(Realm realm) throws Exception ; 100 101 107 public List <Policy> getPolicies() throws Exception ; 108 109 117 public void grantPolicyToPrincipal(Policy policy, Principal principal) throws Exception ; 118 119 127 public void revokePolicyFromPrincipal(Policy policy, Principal principal) throws Exception ; 128 129 135 public void revokeAllPoliciesFromPrincipal(Principal principal) throws Exception ; 136 137 147 public void attachResourceToPolicy(Resource resource, Policy policy, int sequence, Realm realm) throws Exception ; 148 149 158 public void detachResourceFromPolicy(Resource resource, Policy policy, Realm realm) throws Exception ; 159 160 169 public boolean isResourceAttachedToPolicy(Resource resource, Policy policy, Realm realm) throws Exception ; 170 171 186 public boolean isPrincipalAllowed(Principal principal, Resource resource, boolean includeSuperUser) throws Exception ; 187 188 204 public boolean isPrincipalGrantedResourcesOfType(Principal principal, ResourceType resourceType, List resourceTypesToExclude) throws Exception ; 205 206 215 public List <Integer > getGrantedResourcesOfType(Principal principal, ResourceType resourceType) throws Exception ; 216 217 218 226 public List <Policy> getPoliciesAttachedToResource(Resource resource, Realm realm) throws Exception ; 227 228 236 public List <Principal> getPrincipalsGrantedPolicy(Policy policy, Realm realm) throws Exception ; 237 238 245 public void revokePolicyFromAllPrincipals(Policy policy, Realm realm) throws Exception ; 246 247 253 public ResourceType getResourceType(int resourceTypeId); 254 255 263 public Policy getPolicyByName(String name, int realmID) throws Exception ; 264 265 266 274 public AccessRights createAccessRights(AccessRights accessRights) throws Exception ; 275 276 282 public List <AccessRights> getAccessRights() throws Exception ; 283 284 290 public List <AccessRights> getAccessRights(int realmID) throws Exception ; 291 292 300 public AccessRights getAccessRightsByName(String name, int realmID) throws Exception ; 301 302 309 public AccessRights getAccessRight(int id) throws Exception ; 310 311 322 public boolean isPermitted(ResourceType resourceType, Permission[] permissions, User user, boolean all) 323 throws Exception ; 324 325 336 public List <AccessRights> getAccessRights(ResourceType resourceType, Permission permission, String permissionClass, User user) 337 throws Exception ; 338 339 350 public List <AccessRights> getPermittingAccessRights(ResourceType resourceType, Permission permission, String permissionClass, User user) throws Exception ; 351 352 363 public boolean isAnyAccessRightAllowed(User user, boolean delegation, boolean system, boolean personal) throws Exception ; 364 365 372 public AccessRights deleteAccessRights(int id) throws Exception ; 373 374 380 public void updateAccessRights(AccessRights permission) throws Exception ; 381 382 387 public void initAccessRights() throws Exception ; 388 389 400 public List <Policy> getPoliciesOfDelegatedAccessRights(ResourceType resourceType, String permissionClass, User user) 401 throws Exception ; 402 403 409 public int getEveryonePolicyIDForRealm(Realm realm)throws Exception ; 410 411 419 public boolean isResourceInRealm(Resource resource, Realm realm) throws Exception ; 420 421 429 public Policy getGrantingPolicyForUser(User user, Resource resource) throws Exception ; 430 431 440 public boolean isPolicyGrantedToUser(Policy policy, User user) throws Exception ; 441 442 449 public void detachResourceFromPolicyList(Resource resource, SessionInfo session) throws Exception ; 450 451 459 public void attachResourceToPolicyList(Resource resource, PropertyList selectedPolicies, SessionInfo session) throws Exception ; 460 461 } 462 | Popular Tags |