getPermissionGrants
List<PermissionGrant> getPermissionGrants(ProtectionDomain domain)
Returns a new List containing immutable PermissionGrant's, the
List returned is not synchronised and must not be shared with policy
internal state.
Only those PermissionGrant's that imply the domain will be returned.
If any PermissionGrant's are privileged (contain AllPermission), then
only that one PermissionGrant should be added to the collection. If
a List has a size of 1, and contains only a privileged PermissionGrant,
it enables the calling policy to determine the privileged state quickly.
If a policy has a privileged PermissionGrant to add to a Collection,
then the Collection must be cleared before the privileged PermissionGrant
is added, so the Collection only contains the privileged PermissionGrant.
The top level policy gathers all PermissionGrant's,
retrieves all relevant permissions, then sorts them using a
PermissionComparator, so Permission objects are added to a
PermissionCollection in the most efficient order.
If a nested base policy doesn't support ScalableNestedPolicy, then the
implementer should create a PermissionGrant for the domain, containing
the Permission objects returned from the policy.
The first nested base policy (usually a file policy provider) is
responsible for merging any static Permission objects from the
ProtectionDomain.
- Parameters:
domain
- ProtectionDomain grants apply to
- Returns:
- List of PermissionGrant's