CRM-15819 - separate permission for Message Templates editing.
[civicrm-core.git] / CRM / Core / Permission.php
index 2fbb94e9cdb1ba39b67d92b6bac88649f43d5904..88d3628547c1d2f7f39065dfb3e0fd2677f31241 100644 (file)
@@ -23,7 +23,7 @@
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  *
@@ -114,9 +114,8 @@ class CRM_Core_Permission {
    *    array('access CiviEvent', 'access CiviContribute')
    *  ),
    *
-   * @return boolean
+   * @return bool
    *   true if yes, else false
-   * @static
    */
   public static function check($permissions) {
     $permissions = (array) $permissions;
@@ -163,9 +162,8 @@ class CRM_Core_Permission {
    * @param array $array
    *   The group/role to check.
    *
-   * @return boolean
+   * @return bool
    *   true if yes, else false
-   * @static
    */
   public static function checkGroupRole($array) {
     $config = CRM_Core_Config::singleton();
@@ -199,7 +197,6 @@ class CRM_Core_Permission {
    * @param bool $excludeHidden
    *   exclude hidden groups.
    *
-   * @static
    *
    * @return array
    *   array reference of all groups.
@@ -667,6 +664,7 @@ class CRM_Core_Permission {
       'export own manual batches' => $prefix . ts('export own manual batches'),
       'export all manual batches' => $prefix . ts('export all manual batches'),
       'administer payment processors' => $prefix . ts('administer payment processors'),
+      'edit message templates' => $prefix . ts('edit message templates'),
     );
 
     return $permissions;
@@ -676,8 +674,8 @@ class CRM_Core_Permission {
    * Validate user permission across
    * edit or view or with supportable acls.
    *
-   * return boolean true/false.
-   **/
+   * @return bool
+   */
   public static function giveMeAllACLs() {
     if (CRM_Core_Permission::check('view all contacts') ||
       CRM_Core_Permission::check('edit all contacts')
@@ -715,10 +713,8 @@ class CRM_Core_Permission {
    *
    * @param string $permission
    *
-   * return string $componentName the name of component.
-   *
-   * @return int|null|string
-   * @static
+   * @return null|string
+   *   the name of component.
    */
   public static function getComponentName($permission) {
     $componentName = NULL;
@@ -784,4 +780,5 @@ class CRM_Core_Permission {
       'is_enabled'
     ) ? TRUE : FALSE;
   }
+
 }