Replaces the existing RemotePolicy's PermissionGrant's.
The array is defensively copied, the caller, must have
as well as GrantPermission or UmbrellaGrantPermission for every
Permission granted by each PermissionGrant.
If the calling Subject doesn't have sufficient permission, the
first permission that fails will include the SecurityException as the
cause of the thrown IOException.
Permissions required by the callers Subject should be set in the
local policy files at the RemotePolicy server.
Where an IOException is thrown, no update to the
RemotePolicy has occurred.
Returns a new List containing immutable PermissionGrant's, the
List returned is not synchronised and must not be shared with policy
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