Fix has_perm and has_module_perm method bugs.
Permission checking always return false.
