CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Custom Group - Tab does not appear even with permission through ACL
Pages: [1]

Author Topic: Custom Group - Tab does not appear even with permission through ACL  (Read 5484 times)

kdas

  • I post occasionally
  • **
  • Posts: 44
  • Karma: 0
Custom Group - Tab does not appear even with permission through ACL
August 07, 2009, 10:31:06 pm
Hi all,

civicrm 2.2 issue:

If you create a custom group that is set to display as a tab and you have permission at drupal level 'access all custom data'  in the civicrm module, you see the tab fine.

If you do not have 'access all custom data' permission  but still have permission through ACL to view/edit the custom group, the tab does not appear.  Though if you change the custom group to Inline instead of Tab it works fine.

My requirement is to use 'multiple' records option that requires to use the Tab. So I am stuck. If I give 'access all custom data'  permission it exposes other custom groups to users that I don't want.

Is there a solution or a simple fix that can be applied in code after copying file to custom php area?

Thanks,
-kdas

kdas

  • I post occasionally
  • **
  • Posts: 44
  • Karma: 0
Re: Custom Group - Tab does not appear even with permission through ACL
August 08, 2009, 09:29:53 am
It tried to debug the code and it seems I found the problem.

In CRM/Core/BAO/CustomGroup.php, function "public static function &getActiveGroups(...)" there is a line:
$permissionClause = CRM_Core_Permission::customGroupClause( null, null, true );

The first parameter is null in CRM_Core_Permission::customGroupClause(...).

In function CRM_Core_Permission::customGroupClause (CRM/Core/Permission.php) if the first parameter '$type' is null it should replace it with CRM_Core_Permission::VIEW default value and that is not happening.

When I replaced line in CRM/Core/BAO/CustomGroup.php:
$permissionClause = CRM_Core_Permission::customGroupClause( null, null, true );
With
$permissionClause = CRM_Core_Permission::customGroupClause( CRM_Core_Permission::VIEW, null, true );
it seems to work.

Not sure if I introduced any other issue with this change.

Can someone in civicrm development could verify this or suggest a better alternative?

Regards,
kdas

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Custom Group - Tab does not appear even with permission through ACL
August 08, 2009, 07:08:04 pm
Please file an issue for this - include your recommended change and we'll review it. Thx for making the effort to locate the bug!
Protect your investment in CiviCRM by  becoming a Member!

Raphy

  • Guest
Re: Custom Group - Tab does not appear even with permission through ACL
November 29, 2009, 10:17:14 pm
This seems to be a problem for 3.0.2 as well.

We have tried ACLs on custom data group and when in tab mode they do not appear for the person/group with permissions, but when inline it works fine.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Custom Group - Tab does not appear even with permission through ACL
November 30, 2009, 08:30:26 am

can u try the patch recommended by kdas and see if that works?

if so, can u please file an issue and post to this forum thread and we'll fix in a future version

thanx

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Raphy

  • Guest
Re: Custom Group - Tab does not appear even with permission through ACL
November 30, 2009, 04:56:35 pm
Yes, this patch worked. Thanks so much. I will now file an issue. http://issues.civicrm.org/jira/browse/CRM-5518
« Last Edit: December 08, 2009, 07:26:28 pm by Raphy »

ChrisChinchilla

  • I post occasionally
  • **
  • Posts: 104
  • Karma: 3
  • CiviCRM version: 4.1.2
  • CMS version: Drupal 6 & 7
Re: Custom Group - Tab does not appear even with permission through ACL
August 15, 2013, 08:45:47 pm
Hey everyone, I'm having a similar problem with 4.3

So, every ACL role seems to have the appropriate permissions unyet if a user with the correct role logs in and tries to edit a custom field set in a tab, there is no edit button.

The patch made as a result of this post is there and I have tracked down my (maybe) related issue to…

Contact/Page/View/CustomData.php line 103 - 106

$permUser = CRM_Core_Permission::getPermission();
$editCustomData = (CRM_Core_Permission::VIEW == $permUser) ? 0 : 1;
$this->assign('editCustomData', $editCustomData);

The second line seems odd to me perhaps? Should it not be 'EDIT', if I'm understanding how this works?

Also, I debugged what was going on and if a user had a role with ID 3 (for example) it seems to constantly only return 2, which is 'Authenticated user', and hence the ACLs are ignored.

I do have Eileen's related permissions extension enabled, maybe that could be causing problems?

Hopefully that all makes sense!
Melbourne CiviCRM meetup group - http://www.meetup.com/MelbourneCiviCRM/

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Custom Group - Tab does not appear even with permission through ACL

This forum was archived on 2017-11-26.