This method of the PermissionSet Class copies the contents of the PermissionSet, and then returns it as a PermissionDataSet that can be examined and modified. Any changes to the resulting PermissionDataSet will not affect the original PermissionSet.
public PermissionDataSet getPermissions();
Returns a copy of the contents of the PermissionSet as a PermissionDataSet.