Merge pull request #7970 from otetard/CRM-18235
[civicrm-core.git] / CRM / Event / Info.php
index c471626f2e92b34c43ef504ddb69b9b86dd6c74a..a92c94933860916f0b349077d0d7544845993d15 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.6                                                |
+ | CiviCRM version 4.7                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014                                |
+ | Copyright CiviCRM LLC (c) 2004-2016                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -31,7 +31,7 @@
  * abstract class.
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
+ * @copyright CiviCRM LLC (c) 2004-2016
  * $Id$
  *
  */
@@ -59,19 +59,53 @@ class CRM_Event_Info extends CRM_Core_Component_Info {
   /**
    * @inheritDoc
    * @param bool $getAllUnconditionally
+   * @param bool $descriptions
+   *   Whether to return permission descriptions
    *
    * @return array
    */
-  public function getPermissions($getAllUnconditionally = FALSE) {
-    return array(
-      'access CiviEvent',
-      'edit event participants',
-      'edit all events',
-      'register for events',
-      'view event info',
-      'view event participants',
-      'delete in CiviEvent',
+  public function getPermissions($getAllUnconditionally = FALSE, $descriptions = FALSE) {
+    $permissions = array(
+      'access CiviEvent' => array(
+        ts('access CiviEvent'),
+        ts('Create events, view all events, and view participant records (for visible contacts)'),
+      ),
+      'edit event participants' => array(
+        ts('edit event participants'),
+        ts('Record and update backend event registrations'),
+      ),
+      'edit all events' => array(
+        ts('edit all events'),
+        ts('Edit events even without specific ACL granted'),
+      ),
+      'register for events' => array(
+        ts('register for events'),
+        ts('Register for events online'),
+      ),
+      'view event info' => array(
+        ts('view event info'),
+        ts('View online event information pages'),
+      ),
+      'view event participants' => array(
+        ts('view event participants'),
+      ),
+      'delete in CiviEvent' => array(
+        ts('delete in CiviEvent'),
+        ts('Delete participants and events that you can edit'),
+      ),
+      'manage event profiles' => array(
+        ts('manage event profiles'),
+        ts('Allow users to create, edit and copy event-related profile forms used for online event registration.'),
+      ),
     );
+
+    if (!$descriptions) {
+      foreach ($permissions as $name => $attr) {
+        $permissions[$name] = array_shift($attr);
+      }
+    }
+
+    return $permissions;
   }
 
   /**