+
+ $isProfile = FALSE;
+ while ($dao->fetch()) {
+ $isProfile = ($isProfile || ($dao->module == "Profile"));
+ }
+
+ //Check that the user has the "add contacts" Permission
+ $canAdd = CRM_Core_Permission::check("add contacts");
+
+ //Remove need for Profile module type when using reserved profiles [CRM-14488]
+ if (!$dao->N || (!$isProfile && !($dao->is_reserved && $canAdd))) {