All of the operations defined for permission objects are useful for working with sets of different types of permissions. Permission objects refer to a generic object of a specific type – file, registry, etc.: all these methods on permission objects can equally be applied to a set of permissions of various types. The PermissionSet class object represents such sets of permission objects, and supports all features of the base permission classes (implements IPermission) so it can be used as if a single permission.
Permission sets are explicitly constructed from zero or more permission objects.
PermissionSet (); // empty permission set PermissionSet (IPermission permission); // set of one perm. PermissionSet (IPermission p1, IPermission p2); // set of two PermissionSet (IPermission [] permission); // set of many
Permission sets may be created from named permission sets as defined for policy (see policy spec).
PermissionSet (String name);
The following pseudo-code demonstrates how common operations are defined for permission sets. Given two permission sets containing two permission types A and B, for P1={A1,B1} and P2={A2,B2}: