Package org.wicketstuff.security.hive
Interface Hive
-
- All Known Implementing Classes:
BasicHive,SimpleCachingHive
public interface HiveA Hive contains the security policy for the system, much like thePolicyin JAAS does. However where the Policy only has a single instance for each virtual machine, multiple Hives are allowed per vm. Allowing for instance multiple web applications to each have there own security policies or share one. In effect making a hive a codebased policy. TheHiveMindkeeps a registry of hives based on keys, everyone with the right key can access that hive, this allows you to choose if multiple (different) webapps all share the same same hive or let each instance of an application have there own hive. The key (sometimes referred to as the "queen", to stick with wasp terminology ;)) can be any object. A good choice would be the application itself or if it is a web application the contextname could be used.- Author:
- marrink
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancontainsPermission(Permission permission)Checks if this hive contains exactly the permission.booleancontainsPrincipal(Principal principal)Checks if this hive contains an exact match for this principal.Set<Permission>getPermissions(Principal principal)Returns a set ofPermissions, contained within the principal.Set<Principal>getPrincipals(Permission permission)Returns a set ofPrincipals, each containing this permission.booleanhasPermission(Subject subject, Permission permission)Checks if the subject has the exact permission, or if the permission is implied by any of the subjects principals.
-
-
-
Method Detail
-
containsPrincipal
boolean containsPrincipal(Principal principal)
Checks if this hive contains an exact match for this principal.- Parameters:
principal-- Returns:
- true if the hive contains the principal, false otherwise.
-
containsPermission
boolean containsPermission(Permission permission)
Checks if this hive contains exactly the permission.- Parameters:
permission-- Returns:
- true if the hive contains the permission.
-
hasPermission
boolean hasPermission(Subject subject, Permission permission)
Checks if the subject has the exact permission, or if the permission is implied by any of the subjects principals.- Parameters:
subject- the (optional) subjectpermission- the permission to check.- Returns:
- true if the subject has or implies the permission, false otherwise.
-
getPrincipals
Set<Principal> getPrincipals(Permission permission)
Returns a set ofPrincipals, each containing this permission. Implementors must not allow modifications to the set change the internal state of the hive.- Parameters:
permission-- Returns:
- set, never null
-
getPermissions
Set<Permission> getPermissions(Principal principal)
Returns a set ofPermissions, contained within the principal. Implementors must not allow modifications to the set change the internal state of the hive.- Parameters:
principal-- Returns:
- set, never null
-
-