[REFACTOR] Deduplicate code of actions for changing write access

Change-Id: Icd974253f9e37c6f74afeb1490463b4e4aed8b03
Reviewed-on: http://saros-build.imp.fu-berlin.de/gerrit/1547
Tested-by: Jenkins CI
Reviewed-by: Damla Durmaz <ddurmaz88@gmail.com>
Reviewed-by: Stefan Rossbach <srossbach@arcor.de>
Reviewed-by: Franz Zieris <zieris@inf.fu-berlin.de>