clean up imports
downgraded privs should always compare from all_privs so that the appropriate downgrades are made
Merge pull request #2514 from dimagi/handle-downgrade-from-all

Downgrades should be comparing new privs to max privs