Merge pull request #11268 from mattwire/CRM-21421_allow_updating_existing_casecontact
[civicrm-core.git] / CRM / Core / Permission.php
index 1e28ab6fdb0ae0bcc6e034592ee4dd1ec765ad50..d6a1915cb3cda0edcc6f4a649587f054bcb4cb33 100644 (file)
@@ -826,6 +826,22 @@ class CRM_Core_Permission {
         $prefix . ts('edit all manual batches'),
         ts('Edit all accounting batches'),
       ),
+      'close own manual batches' => array(
+        $prefix . ts('close own manual batches'),
+        ts('Close accounting batches created by user (with Access to CiviContribute)'),
+      ),
+      'close all manual batches' => array(
+        $prefix . ts('close all manual batches'),
+        ts('Close all accounting batches (with Access to CiviContribute)'),
+      ),
+      'reopen own manual batches' => array(
+        $prefix . ts('reopen own manual batches'),
+        ts('Reopen accounting batches created by user (with Access to CiviContribute)'),
+      ),
+      'reopen all manual batches' => array(
+        $prefix . ts('reopen all manual batches'),
+        ts('Reopen all accounting batches (with Access to CiviContribute)'),
+      ),
       'view own manual batches' => array(
         $prefix . ts('view own manual batches'),
         ts('View accounting batches created by user (with Access to CiviContribute)'),
@@ -1587,8 +1603,7 @@ class CRM_Core_Permission {
    *   invoices permission and the invoice author is the current user.
    */
   public static function checkDownloadInvoice() {
-    global $user;
-    $cid = CRM_Core_BAO_UFMatch::getContactId($user->uid);
+    $cid = CRM_Core_Session::getLoggedInContactID();
     if (CRM_Core_Permission::check('access CiviContribute') ||
       (CRM_Core_Permission::check('view my invoices') && $_GET['cid'] == $cid)
     ) {