Commit cf5f38d3 authored by Christian Wach's avatar Christian Wach
Browse files

Tweak inline comments

parent 24cfc3e2
......@@ -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;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment