Refactor PermissionsHelper.php

Change-Id: I0aed1ef22cca1a92a2d45f9872a843dc61fe01ae