removes unnecessary permissions