Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
justinfreeman (Agileware)
Core
Commits
4f8ec8be
Commit
4f8ec8be
authored
11 years ago
by
Deepak Srivastava
Browse files
Options
Downloads
Patches
Plain Diff
CRM-13546 - Custom fields in CiviReport: 'access all custom data' permission not respected
parent
4441ae6c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CRM/Report/Form.php
+11
-8
11 additions, 8 deletions
CRM/Report/Form.php
with
11 additions
and
8 deletions
CRM/Report/Form.php
+
11
−
8
View file @
4f8ec8be
...
@@ -279,14 +279,17 @@ class CRM_Report_Form extends CRM_Core_Form {
...
@@ -279,14 +279,17 @@ class CRM_Report_Form extends CRM_Core_Form {
// Get all custom groups
// Get all custom groups
$allGroups
=
CRM_Core_PseudoConstant
::
get
(
'CRM_Core_DAO_CustomField'
,
'custom_group_id'
);
$allGroups
=
CRM_Core_PseudoConstant
::
get
(
'CRM_Core_DAO_CustomField'
,
'custom_group_id'
);
// Get the custom groupIds for which the user have VIEW permission
// Get the custom groupIds for which the user has VIEW permission
require_once
'CRM/ACL/API.php'
;
// If the user has 'access all custom data' permission, we'll leave $permCustomGroupIds empty
$permCustomGroupIds
=
CRM_ACL_API
::
group
(
CRM_Core_Permission
::
VIEW
,
NULL
,
'civicrm_custom_group'
,
$allGroups
,
NULL
);
// and addCustomDataToColumns() will allow access to all custom groups.
$permCustomGroupIds
=
array
();
// do not allow custom data for reports if user don't have
if
(
!
CRM_Core_Permission
::
check
(
'access all custom data'
))
{
// permission to access custom data.
$permCustomGroupIds
=
CRM_ACL_API
::
group
(
CRM_Core_Permission
::
VIEW
,
NULL
,
'civicrm_custom_group'
,
$allGroups
,
NULL
);
if
(
!
empty
(
$this
->
_customGroupExtends
)
&&
!
CRM_Core_Permission
::
check
(
'access all custom data'
)
&&
empty
(
$permCustomGroupIds
))
{
// do not allow custom data for reports if user doesn't have
$this
->
_customGroupExtends
=
array
();
// permission to access custom data.
if
(
!
empty
(
$this
->
_customGroupExtends
)
&&
empty
(
$permCustomGroupIds
))
{
$this
->
_customGroupExtends
=
array
();
}
}
}
// merge custom data columns to _columns list, if any
// merge custom data columns to _columns list, if any
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment