Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
extensions
Call Next Dashlet
Commits
cf5f38d3
Commit
cf5f38d3
authored
Sep 10, 2019
by
Christian Wach
⚽
Browse files
Tweak inline comments
parent
24cfc3e2
Changes
1
Hide whitespace changes
Inline
Side-by-side
CRM/CallNextDashlet/Page/CallNextDashlet.php
View file @
cf5f38d3
...
...
@@ -262,26 +262,25 @@ class CRM_CallNextDashlet_Page_CallNextDashlet extends CRM_Core_Page {
*/
public
static
function
can_view_contact
(
$contactID
)
{
// automatically grant permissin for users on their own record. makes
// things easier in dashboard
// Access session.
$session
=
CRM_Core_Session
::
singleton
();
// Allow if it's me and I have the permission.
// Allow if it's me and I have the
relevant
permission.
if
(
$session
->
get
(
'userID'
)
==
$contactID
AND
CRM_Core_Permission
::
check
(
'edit my contact'
))
{
return
TRUE
;
}
// Allow if it's a deleted Contact and I have the permission.
// Allow if it's a deleted Contact and I have the
relevant
permission.
elseif
(
CRM_Core_DAO
::
getFieldValue
(
'CRM_Contact_DAO_Contact'
,
$contactID
,
'is_deleted'
)
AND
CRM_Core_Permission
::
check
(
'access deleted contacts'
))
{
return
TRUE
;
}
// Allow if it's a Contact I can edit.
// Allow if it's a Contact
that
I can edit.
elseif
(
CRM_Contact_BAO_Contact_Permission
::
allow
(
$contactID
,
CRM_Core_Permission
::
EDIT
))
{
return
TRUE
;
}
// Allow if it's a Contact I can view.
// Allow if it's a Contact
that
I can view.
elseif
(
CRM_Contact_BAO_Contact_Permission
::
allow
(
$contactID
,
CRM_Core_Permission
::
VIEW
))
{
return
TRUE
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment