hotfix: expose validate permission function through the module.
rewrote getProfile to fit the new standards