INFRA-132 add full stops
[civicrm-core.git] / CRM / Core / Permission.php
index 9b168cd768eb7fce75f59197c11020be7e581db8..86ee19f6b2d8060a2b06aa737545a3533bc48332 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        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  *
@@ -39,7 +39,7 @@
 class CRM_Core_Permission {
 
   /**
-   * Static strings used to compose permissions
+   * Static strings used to compose permissions.
    *
    * @const
    * @var string
@@ -47,31 +47,31 @@ class CRM_Core_Permission {
   const EDIT_GROUPS = 'edit contacts in ', VIEW_GROUPS = 'view contacts in ';
 
   /**
-   * The various type of permissions
+   * The various type of permissions.
    *
    * @var int
    */
   const EDIT = 1, VIEW = 2, DELETE = 3, CREATE = 4, SEARCH = 5, ALL = 6, ADMIN = 7;
 
   /**
-   * A placeholder permission which always fails
+   * A placeholder permission which always fails.
    */
   const ALWAYS_DENY_PERMISSION = "*always deny*";
 
   /**
-   * A placeholder permission which always fails
+   * A placeholder permission which always fails.
    */
   const ALWAYS_ALLOW_PERMISSION = "*always allow*";
 
   /**
-   * Various authentication sources
+   * Various authentication sources.
    *
    * @var int
    */
   const AUTH_SRC_UNKNOWN = 0, AUTH_SRC_CHECKSUM = 1, AUTH_SRC_SITEKEY = 2, AUTH_SRC_LOGIN = 4;
 
   /**
-   * Get the current permission of this user
+   * Get the current permission of this user.
    *
    * @return string
    *   the permission of the user (edit or view or null)
@@ -85,7 +85,7 @@ class CRM_Core_Permission {
    * Given a permission string or array, check for access requirements
    * @param mixed $permissions
    *   The permission to check as an array or string -see examples.
-   *  arrays
+   *   arrays
    *
    *  Ex 1
    *
@@ -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;
@@ -143,7 +142,7 @@ class CRM_Core_Permission {
   }
 
   /**
-   * Determine if any one of the permissions strings applies to current user
+   * Determine if any one of the permissions strings applies to current user.
    *
    * @param array $perms
    * @return bool
@@ -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();
@@ -173,7 +171,7 @@ class CRM_Core_Permission {
   }
 
   /**
-   * Get the permissioned where clause for the user
+   * Get the permissioned where clause for the user.
    *
    * @param int $type
    *   The type of permission needed.
@@ -196,9 +194,9 @@ class CRM_Core_Permission {
    *
    * @param string $groupType
    *   Type of group(Access/Mailing).
-   * @param bool|\boolen $excludeHidden exclude hidden groups.
+   * @param bool $excludeHidden
+   *   exclude hidden groups.
    *
-   * @static
    *
    * @return array
    *   array reference of all groups.
@@ -433,7 +431,7 @@ class CRM_Core_Permission {
   }
 
   /**
-   * Check permissions for delete and edit actions
+   * Check permissions for delete and edit actions.
    *
    * @param string $module
    *   Component name.
@@ -666,17 +664,18 @@ 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;
   }
 
   /**
-   * Validate user permission across
+   * 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')
@@ -714,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;
@@ -748,7 +745,7 @@ class CRM_Core_Permission {
   }
 
   /**
-   * Get all the contact emails for users that have a specific permission
+   * Get all the contact emails for users that have a specific permission.
    *
    * @param string $permissionName
    *   Name of the permission we are interested in.
@@ -762,7 +759,7 @@ class CRM_Core_Permission {
   }
 
   /**
-   * Get all the contact emails for users that have a specific role
+   * Get all the contact emails for users that have a specific role.
    *
    * @param string $roleName
    *   Name of the role we are interested in.
@@ -783,4 +780,5 @@ class CRM_Core_Permission {
       'is_enabled'
     ) ? TRUE : FALSE;
   }
+
 }