public interface Hive
Policy
in 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. The HiveMind
keeps 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.Modifier and Type | Method and Description |
---|---|
boolean |
containsPermission(Permission permission)
Checks if this hive contains exactly the permission.
|
boolean |
containsPrincipal(Principal principal)
Checks if this hive contains an exact match for this principal.
|
Set<Permission> |
getPermissions(Principal principal)
Returns a set of
Permission s, contained within the principal. |
Set<Principal> |
getPrincipals(Permission permission)
Returns a set of
Principal s, each containing this permission. |
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.
|
boolean containsPrincipal(Principal principal)
principal
- boolean containsPermission(Permission permission)
permission
- boolean hasPermission(Subject subject, Permission permission)
subject
- the (optional) subjectpermission
- the permission to check.Set<Principal> getPrincipals(Permission permission)
Principal
s, each containing this permission. Implementors must not
allow modifications to the set change the internal state of the hive.permission
- Set<Permission> getPermissions(Principal principal)
Permission
s, contained within the principal. Implementors must not
allow modifications to the set change the internal state of the hive.principal
- Copyright © 2015. All rights reserved.