<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
class CRM_Core_Permission_Drupal6 extends CRM_Core_Permission_DrupalBase {
/**
- * is this user someone with access for the entire system
+ * Is this user someone with access for the entire system
*
* @var boolean
*/
protected $_editAdminUser = FALSE;
/**
- * am in in view permission or edit permission?
+ * Am in in view permission or edit permission?
* @var boolean
*/
protected $_viewPermission = FALSE;
protected $_editPermission = FALSE;
/**
- * the current set of permissioned groups for the user
+ * The current set of permissioned groups for the user
*
* @var array
*/
protected $_editPermissionedGroups;
/**
- * given a permission string, check for access requirements
+ * Given a permission string, check for access requirements
*
- * @param string $str the permission to check
+ * @param string $str
+ * The permission to check.
*
- * @param null $contactID
+ * @param int $contactID
*
* @return boolean true if yes, else false
- * @access public
*/
- function check($str, $contactID = NULL) {
+ public function check($str, $contactID = NULL) {
$str = $this->translatePermission($str, 'Drupal6', array(
'view user account' => 'access user profiles',
'administer users' => 'administer users',
/**
* Given a roles array, check for access requirements
*
- * @param array $array the roles to check
+ * @param array $array
+ * The roles to check.
*
* @return boolean true if yes, else false
- * @access public
*/
- function checkGroupRole($array) {
+ public function checkGroupRole($array) {
if (function_exists('user_load') && isset($array)) {
$user = user_load(array('uid' => $GLOBALS['user']->uid));
//if giver roles found in user roles - return true
/**
* Get all the contact emails for users that have a specific role
*
- * @param string $roleName name of the role we are interested in
+ * @param string $roleName
+ * Name of the role we are interested in.
*
* @return string a comma separated list of email addresses
*/
/**
* Get all the contact emails for users that have a specific permission
*
- * @param string $permissionName name of the permission we are interested in
+ * @param string $permissionName
+ * Name of the permission we are interested in.
*
* @return string a comma separated list of email addresses
*/
*
* Does nothing in Drupal 6.
*/
- function upgradePermissions($permissions) {
+ public function upgradePermissions($permissions) {
// D6 allows us to be really lazy... things get cleaned up when the admin form is next submitted...
}
*
* @return Array of permissions, in the same format as CRM_Core_Permission::getCorePermissions().
*/
- static function getModulePermissions($module) {
+ public static function getModulePermissions($module) {
$return_permissions = array();
$fn_name = "{$module}_civicrm_permission";
if (function_exists($fn_name)) {
return $return_permissions;
}
}
-