Updated how hasPermission checks the permission

@digilord, thanks for this solution
(digilord/managedUsers/commit/cdb59a46e1e7be6212c3c75479045b4f807ac02f)