Skip to content

Commit

Permalink
Fix permission checks on contact create popups
Browse files Browse the repository at this point in the history
  • Loading branch information
colemanw committed Jan 30, 2019
1 parent eda4400 commit acf315d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CRM/Contact/BAO/Contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -3651,7 +3651,7 @@ public static function isFieldHasLocationType($fieldTitle) {
* @return bool
*/
public static function entityRefCreateLinks() {
return CRM_Core_Permission::check([['edit all contacts', 'add contacts']]);
return CRM_Core_Permission::check([['profile create', 'profile listings and forms']]);
}

}
3 changes: 3 additions & 0 deletions CRM/Core/BAO/UFGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -3328,6 +3328,9 @@ public static function setComponentDefaults(&$fields, $componentId, $component,
* @return array
*/
public static function getCreateLinks($profiles = '', $appendProfiles = array()) {
if (!CRM_Contact_BAO_Contact::entityRefCreateLinks()) {
return [];
}
// Default to contact profiles
if (!$profiles) {
$profiles = array('new_individual', 'new_organization', 'new_household');
Expand Down

0 comments on commit acf315d

Please sign in to comment.