Add profile authorization and corresponding tests