Question: Business requirement is to flip a few permission sets on community profile, based on certain changes in records. These changes are usually triggered as result of actions from other community users only. 

So far with community user, I am able to associate new PermissionSets via Apex. But as soon as I try to remove any permission set from Community user, it gives following error:

```
Delete failed. First exception on row 0 with id 0PaE00000049P4VKAU; first error: FIELD_INTEGRITY_EXCEPTION, You can't revoke your own ability to Manage Profiles and Permission Sets: [Permissions]

```

Seems I need to give following permission:
![enter image description here](https://i.stack.imgur.com/BZLGv.png)

But on trying to enable this permission on a permissionset associated with Community User, following error comes:
![enter image description here](https://i.stack.imgur.com/GADYY.png)

All this logic works perfect via Dev Console (i.e. Admin User). But I don't see a way to make a particular code run as admin user, I tried "without sharing" and trigger/future contexts to do the same, but it didn't succeeded. 

Please advise.

Answer: 
The parsing truncated the result due a Decimal value `.0100`. Json was not able to recognise this as a decimal value as it started with the decimal or dot `.` without a leading `0`. Once we corrected this value to `0.0100`, the full result was returned.
There is query identifier in the "nextRecordsUrl" field of response which signifies that current response is truncated due to size limit. You have to make additional request calls, may be in loop to fetch the complete result.

In simple word, have loop till the response is having "nextRecordsUrl" field and keep making additional request call till then.

Refer to this link for reference:
 <http://www.salesforce.com/us/developer/docs/api_rest/Content/resources_query.htm>