Merge pull request #17840 from seamuslee001/5272_rns
[civicrm-core.git] / api / v3 / Acl.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
5 | |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
10 */
11
12 /**
13 * This api exposes CiviCRM Acl records.
14 *
15 * @package CiviCRM_APIv3
16 */
17
18 /**
19 * Save an Acl.
20 *
21 * @param array $params
22 *
23 * @return array
24 * API result array
25 */
26 function civicrm_api3_acl_create($params) {
27 return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params, 'Acl');
28 }
29
30 /**
31 * Acl create metadata.
32 *
33 * @param array $params
34 */
35 function _civicrm_api3_acl_create_spec(&$params) {
36 $params['is_active']['api.default'] = 1;
37 $params['entity_table']['api.default'] = 'civicrm_acl_role';
38 }
39
40 /**
41 * Get an Acl.
42 *
43 * @param array $params
44 *
45 * @return array
46 * API result array
47 */
48 function civicrm_api3_acl_get($params) {
49 return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
50 }
51
52 /**
53 * Delete an Acl.
54 *
55 * @param array $params
56 *
57 * @return array
58 * API result array
59 */
60 function civicrm_api3_acl_delete($params) {
61 return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
62 }