Move the permission method outside of index