Skip to content

Commit

Permalink
Merge pull request #2 from civicrm/master
Browse files Browse the repository at this point in the history
test 1 2 3
  • Loading branch information
seamuslee001 committed Apr 20, 2015
2 parents cafb3b7 + 0359866 commit 9fca84d
Show file tree
Hide file tree
Showing 3,932 changed files with 146,540 additions and 135,647 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*~
*.bak
bower_components
CRM/ACL/DAO
CRM/Activity/DAO
CRM/Auction/DAO
Expand Down Expand Up @@ -113,6 +114,7 @@ civicrm-version.php
civicrm-version.txt
civicrm.config.php
install/langs.php
node_modules
packages/.channels
packages/.depdb
packages/.depdblock
Expand Down Expand Up @@ -144,6 +146,7 @@ drupal/
WordPress
joomla
packages/
tests/output
tests/phpunit/CiviTest/civicrm.settings.local.php
tests/phpunit/CiviTest/truncate.xml
tools/scripts/releaser/releaser.conf
Expand Down
12 changes: 12 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"indent": 2,
"jasmine": true,
"predef": [
"angular",
"inject",
"module",

"CRM"
],
"-W097": true
}
83 changes: 83 additions & 0 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,88 @@
The following people and organizations sponsored and/or contributed new and improved features to the project.

************************************************
Key Contributors and Sponsors for 4.6
************************************************

CiviCRM Team - Atif Shaikh, Coleman Watts, David Greenberg, Donald Lobo,
Eileen McNaughton, Jitendra Purohit, Josh Gowan, Kurund Jalmi,
Michael McAndrew, Monish Deb, Rohan Ramesh Katkar, Tim Otten,
Yashodha Chaku
ADG Communications - Steve Binkowski
AGH Strategies - Andrew Hunt, Jane Hanley, Tommy Bobo, Tyrell Cook
Alex C
Allan Chappell
Amnesty International Spain - Carlos Capote
Andreas Hennings
Andy Clark
Arete Imagine - Marisa Porter, Nate Porter
Blackfly Solutions - Alan Dixon
Botanical Society of America - Toby Lounsbury
Christian Wach
Chris Ward
Circle Interactive - Dave Moreton, Andrew Walker, Dave Jenkins, Maya Gibbs
CiviCoop - Erik Hommel, Jaap Jansma
CiviDesk - Nicolas Ganivet, Sunil Pawar
Community Human Services Corporation - Paul Mosey
Compucorp - Jamie Novick, Greg Meszeros, Robin Mitra, Guanhuan Chen, Chanun Chirattikanon
David Hepper
Detlev Sieber
Drishtant - Ruchi Kumar
Drupal Association - Neil Drumm
Elliott Eggleston
Freeform Solutions - Lola Slade
Future First - David Knoll, John Prescott, Vitor Nobrega
Fuzion, NZ - Chris Burgess, Eileen McNaughton, Peter Davis
Giantrabbit - Anthony Nemirovsky, Peter Haight
Ginkgo Street Labs - Frank J. Gómez, Michael Daryabeygi
GMVCO Databases - Jon-man Cheung, Alex Lee, Craig Almond
Google Summer of Code - Aditya Nambiar, Siddhant Rajagopalan, Torrance Hodgeson
Gnu.org - David Thompson
Jaka Kranjc
JMA Consulting - Joe Murray, Pradeep Nayak, Edsel Lopez
Joanne Chester
Johan Vervloet
John Kingsnorth
jsnyder83
Kathryn Benedicto
Han Velthuis
Ken West
Kirk Jackson
Korlon - Stuart Gaston
Lighthouse Consulting and Design - Brian Shaughnessy
Mattias Michaux
Max
MC3 - Graham Mitchell
Mission Matters - Joshua Aranda
Mobius - Jeremy Proffitt
Northbridge Digital - Oliver Gibson
Symbiotic - Mathieu Lutfy, Samuel Vanhove
National Democratic Institute - Chris Doten
New York State Senate - Ken Zalewski
Niro Solutions
Palente Technology Cooperative - Jon Goldberg, Joseph Lacey
Paul Campbell
Pogstone - Sarah Gladstone
Progressive Tech Project - Alice Aguilar, Jamie McClelland
Registered Nurses Association of Ontario - Stan Dragnev
Richard Van Oosterhout
Seamus Lee
Semper IT - Karin Gerritsen
Skvare - Mark Hanna, Peter Petrik
Squiffle Consulting - Aidan Saunders
Stephen Palmstrom
Systopia - Björn Endres, Fabian Schuttenberg, Martin Peth, Niko Bochan
Tadpole - Dana Skallman, Kevin Cristiano
Tech to the People - Xavier Dutoit
TeNNoX
Tim Mallezie
Toke Høiland-Jørgensen
Veda Consulting - Priyanka Karan, Parvez Saleh, Deepak Srivastava
William Theaker
Web Access - Tony Mazzerella, Nileema Jadhav, Parag Bhilkar, Pratiksha Dubey, Manish More
Wikimedia Foundation - Adam Wight
Zing - Simon West, Andrew Tombs, Vivek Arora

************************************************
Key Contributors and Sponsors for 4.5
************************************************
Expand Down
113 changes: 62 additions & 51 deletions CRM/ACL/API.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
/*
+--------------------------------------------------------------------+
| CiviCRM version 4.5 |
| CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
| Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
Expand All @@ -23,40 +23,41 @@
| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
*/
*/

/**
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2014
* @copyright CiviCRM LLC (c) 2004-2015
* $Id$
*
*/
class CRM_ACL_API {

/**
* The various type of permissions
* The various type of permissions.
*
* @var int
*/
CONST EDIT = 1;
CONST VIEW = 2;
CONST DELETE = 3;
CONST CREATE = 4;
CONST SEARCH = 5;
CONST ALL = 6;
const EDIT = 1;
const VIEW = 2;
const DELETE = 3;
const CREATE = 4;
const SEARCH = 5;
const ALL = 6;

/**
* given a permission string, check for access requirements
* Given a permission string, check for access requirements
*
* @param string $str the permission to check
* @param int $contactID the contactID for whom the check is made
* @param string $str
* The permission to check.
* @param int $contactID
* The contactID for whom the check is made.
*
* @return boolean true if yes, else false
* @static
* @access public
* @return bool
* true if yes, else false
*/
static function check($str, $contactID = NULL) {
public static function check($str, $contactID = NULL) {
if ($contactID == NULL) {
$session = CRM_Core_Session::singleton();
$contactID = $session->get('userID');
Expand All @@ -71,24 +72,31 @@ static function check($str, $contactID = NULL) {
}

/**
* Get the permissioned where clause for the user
* Get the permissioned where clause for the user.
*
* @param int $type the type of permission needed
* @param array $tables (reference ) add the tables that are needed for the select clause
* @param array $whereTables (reference ) add the tables that are needed for the where clause
* @param int $contactID the contactID for whom the check is made
* @param bool $onlyDeleted whether to include only deleted contacts
* @param bool $skipDeleteClause don't add delete clause if this is true,
* this means it is handled by generating query
* @param int $type
* The type of permission needed.
* @param array $tables
* (reference ) add the tables that are needed for the select clause.
* @param array $whereTables
* (reference ) add the tables that are needed for the where clause.
* @param int $contactID
* The contactID for whom the check is made.
* @param bool $onlyDeleted
* Whether to include only deleted contacts.
* @param bool $skipDeleteClause
* Don't add delete clause if this is true,.
* this means it is handled by generating query
*
* @return string the group where clause for this user
* @access public
* @return string
* the group where clause for this user
*/
public static function whereClause($type,
public static function whereClause(
$type,
&$tables,
&$whereTables,
$contactID = NULL,
$onlyDeleted = FALSE,
$contactID = NULL,
$onlyDeleted = FALSE,
$skipDeleteClause = FALSE
) {
// the default value which is valid for rhe final AND
Expand Down Expand Up @@ -135,23 +143,25 @@ public static function whereClause($type,
}

/**
* get all the groups the user has access to for the given operation
* Get all the groups the user has access to for the given operation.
*
* @param int $type the type of permission needed
* @param int $contactID the contactID for whom the check is made
* @param int $type
* The type of permission needed.
* @param int $contactID
* The contactID for whom the check is made.
*
* @param string $tableName
* @param null $allGroups
* @param null $includedGroups
*
* @return array the ids of the groups for which the user has permissions
* @access public
* @return array
* the ids of the groups for which the user has permissions
*/
public static function group(
$type,
$contactID = NULL,
$tableName = 'civicrm_saved_search',
$allGroups = NULL,
$contactID = NULL,
$tableName = 'civicrm_saved_search',
$allGroups = NULL,
$includedGroups = NULL
) {
if ($contactID == NULL) {
Expand All @@ -168,26 +178,27 @@ public static function group(
}

/**
* check if the user has access to this group for operation $type
*
* @param int $type the type of permission needed
* @param $groupID
* @param int $contactID the contactID for whom the check is made
* Check if the user has access to this group for operation $type
*
* @param int $type
* The type of permission needed.
* @param int $groupID
* @param int $contactID
* The contactID for whom the check is made.
* @param string $tableName
* @param null $allGroups
* @param null $includedGroups
* @param bool $flush
*
* @return array the ids of the groups for which the user has permissions
* @access public
* @return array
* the ids of the groups for which the user has permissions
*/
public static function groupPermission(
$type,
$groupID,
$contactID = NULL,
$tableName = 'civicrm_saved_search',
$allGroups = NULL,
$contactID = NULL,
$tableName = 'civicrm_saved_search',
$allGroups = NULL,
$includedGroups = NULL,
$flush = FALSE
) {
Expand All @@ -197,7 +208,7 @@ public static function groupPermission(
//adding a way for unit tests to flush the cache
if ($flush) {
$cache = array();
return;
return NULL;
}
if (!$contactID) {
$session = CRM_Core_Session::singleton();
Expand All @@ -218,5 +229,5 @@ public static function groupPermission(

return in_array($groupID, $groups) ? TRUE : FALSE;
}
}

}
Loading

0 comments on commit 9fca84d

Please sign in to comment.